Esempio n. 1
0
        public void Map_PetitionLevelBothSide_Success()
        {
            Mapper.CreateMap <DataModels.PetitionLevel, WebModels.PetitionLevel>();
            var dataPetitonLevel = new DataModels.PetitionLevel()
            {
                ID    = 2,
                Name  = "PetitionLevel2",
                Limit = 100
            };
            var webPetitionLevel = Mapper.Map <WebModels.PetitionLevel>(dataPetitonLevel);

            Mapper.CreateMap <WebModels.PetitionLevel, DataModels.PetitionLevel>();
            var webPetitionLevel2 = new WebModels.PetitionLevel()
            {
                ID    = 3,
                Name  = "PetitionLevel3",
                Limit = 20
            };
            var dataPetitionLevel2 = Mapper.Map <DataModels.PetitionLevel>(webPetitionLevel2);

            Assert.IsNotNull(webPetitionLevel);
            Assert.AreEqual(webPetitionLevel.ID, 2);
            Assert.AreEqual(webPetitionLevel.Name, "PetitionLevel2");
            Assert.AreEqual(webPetitionLevel.Limit, 100);

            Assert.IsNotNull(dataPetitionLevel2);
            Assert.AreEqual(dataPetitionLevel2.ID, 3);
            Assert.AreEqual(dataPetitionLevel2.Name, "PetitionLevel3");
            Assert.AreEqual(dataPetitionLevel2.Limit, 20);
        }
Esempio n. 2
0
        public void Map_PetitionLevelBothSide_Success()
        {
            Mapper.CreateMap<DataModels.PetitionLevel, WebModels.PetitionLevel>();
            var dataPetitonLevel = new DataModels.PetitionLevel()
                                   {
                                       ID = 2,
                                       Name = "PetitionLevel2",
                                       Limit = 100
                                   };
            var webPetitionLevel = Mapper.Map<WebModels.PetitionLevel>(dataPetitonLevel);

            Mapper.CreateMap<WebModels.PetitionLevel, DataModels.PetitionLevel>();
            var webPetitionLevel2 = new WebModels.PetitionLevel()
                                    {
                                        ID = 3,
                                        Name = "PetitionLevel3",
                                        Limit = 20
                                    };
            var dataPetitionLevel2 = Mapper.Map<DataModels.PetitionLevel>(webPetitionLevel2);

            Assert.IsNotNull(webPetitionLevel);
            Assert.AreEqual(webPetitionLevel.ID, 2);
            Assert.AreEqual(webPetitionLevel.Name, "PetitionLevel2");
            Assert.AreEqual(webPetitionLevel.Limit, 100);

            Assert.IsNotNull(dataPetitionLevel2);
            Assert.AreEqual(dataPetitionLevel2.ID, 3);
            Assert.AreEqual(dataPetitionLevel2.Name, "PetitionLevel3");
            Assert.AreEqual(dataPetitionLevel2.Limit, 20);
        }