Ejemplo n.º 1
0
        public void MapBaseballCardTesting_EntityModel()
        {
            // Arrange
            var testCard = new Entity.BaseballCard
            {
                Id         = 1,
                UserId     = 1,
                PlayerName = "Babe Ruth",
                Team       = "Yankees",
                Year       = 1914,
                Image      = "TestImageLink",
                Location   = "Binder"
            };

            // Act
            var modelCard = Mapper.Map(testCard);

            // Assert
            Assert.Equal(1, modelCard.Id);
            Assert.Equal(1, modelCard.UserId);
            Assert.Equal("Babe Ruth", modelCard.PlayerName);
            Assert.Equal("Yankees", modelCard.Team);
            Assert.Equal(1914, modelCard.Year);
            Assert.Equal("TestImageLink", modelCard.Image);
            Assert.Equal("Binder", modelCard.Location);
        }
Ejemplo n.º 2
0
 public static Entities.BaseballCard Map(Lib.BaseballCard c)
 {
     Entities.BaseballCard card = new Entities.BaseballCard()
     {
         Id         = c.Id,
         UserId     = c.UserId,
         PlayerName = c.PlayerName,
         Team       = c.Team,
         Year       = c.Year,
         Image      = c.Image,
         Location   = c.Location
     };
     return(card);
 }