Electromagnetic calorimeter (ECal) is an important detector of the Multi Purpose Detector (MPD) at the NICA collider. A shashlyk-type electromagnetic calorimeter is selected as MPD ECal. The particular goals of the MPD ECal are to measure of spatial positions and energy of photons and electrons. The whole ECal consists of 43008 shashlyk tower and each tower consists of 220 layers of 1.5mm scitillator +0.3mm lead plates. 16 wavelength-shifted fibers are used to collect light signals. The SiPM detector is used to read out the signals. After being amplified, the signal was sent to a waveform sampling circuit to obtain the waveform of each incident particle. Two ECal prototype modules were developed in Tsinghua University and they were tested with cosmic ray and electron beam. In the cosmic ray test, the distribution of NPE, which is the number of photoelectrons collected by the detector, is obtained. The average NPE is around 450. The beam test was carried out at DESY on August of 2018. MPD ROOT is used to analysis the test data and a well-fit energy linear relationship between NPE and electron energy together with a good energy resolution around 3% were achieved. All these results show that the prototype of ECal is fully capable of the requirement of the NICA-MPD. In this article, we described the structure of the shashlyk module and its performance in beam test.