Mycotoxins are toxins produced directly by or as a byproduct of the metabolism of various fungi. Both yeasts and molds can produce mycotoxins They are tested for primarily using immunological assays like ELISA and others. Essentially polyclonal antibodies that are specific or semi-specific for the various toxins are raised in rabbit, sheep, etc. or monoclonal antibodies are manufactured in various engineered cell lines. . There are also various chromatographic (HPLC, thin-layer, and others) and mass spec based methods. ELISA is by far the most common. Mycotoxin testing needs to be quantitative to be of any use since presence/absence does not really tell you anything about possible health effects. Problem is quantitation by ELISA generally sucks.
Fungal contamination in general is a different thing and is more often a food spoilage rather than safety concern and can also be caused by yeasts and/or molds. In the case of mycotoxins the live fungi does not necessarily have to be present for the toxin to be there and cause illness (bacterial toxins are similar in this respect) but in spoilage processes it generally does. Therefore most often culture and/or microscopic methods are used to detect their presence and for identification. Molecular methods such as PCR can also be used for detection and of course various sequencing approaches typically targeting the 18S ITS region of the fungal ribosomal RNA are used for identification.
It is important to remember that the fungi are much more closely related to plants and animals then bacteria. Even though they are considered micro-organisms and generally are studied by microbiologists, working with them in the lab, their behaviour, biochemistry, life cycles, etc. are very different from the bacteria with which most microbiologists work day to day.