public void NormalToNullables() { var dinner = new Dinner { ChefId = 3 }; var dinnerInput = new DinnerInput(); dinnerInput.InjectFrom<NormalToNullables>(dinner); Assert.AreEqual(3, dinnerInput.ChefId); Assert.AreEqual(null, dinnerInput.Start); Assert.AreEqual(null, dinnerInput.CountryId); }
public void EntitiesToIntsTest() { var dinner = new Dinner { Meals = new List<Meal> { new Meal { Id = 3 }, new Meal { Id = 7 } } }; var dinnerInput = new DinnerInput(); dinnerInput.InjectFrom<EntitiesToInts>(dinner); Assert.IsNotNull(dinnerInput.Meals); Assert.AreEqual(2, dinnerInput.Meals.Count()); Assert.AreEqual(3, dinnerInput.Meals.First()); }
public void NormalToNullables() { var dinner = new Dinner { ChefId = 3 }; var dinnerInput = new DinnerInput(); dinnerInput.InjectFrom <NormalToNullables>(dinner); Assert.AreEqual(3, dinnerInput.ChefId); Assert.AreEqual(null, dinnerInput.Start); Assert.AreEqual(null, dinnerInput.CountryId); }
public void NormalToNullables() { var d = new Dinner { ChefId = 3 }; var di = new DinnerInput(); di.InjectFrom <NormalToNullables>(d); Assert.AreEqual(3, di.ChefId); Assert.AreEqual(null, di.Date); Assert.AreEqual(null, di.CountryId); }
public void EntitiesToIntsTest() { var dinner = new Dinner { Meals = new List <Meal> { new Meal { Id = 3 }, new Meal { Id = 7 } } }; var dinnerInput = new DinnerInput(); dinnerInput.InjectFrom <EntitiesToInts>(dinner); Assert.IsNotNull(dinnerInput.Meals); Assert.AreEqual(2, dinnerInput.Meals.Count()); Assert.AreEqual(3, dinnerInput.Meals.First()); }