public void Does_translate() { var user = new User() { FirstName = "Demis", LastName = "Bellot", Car = new Car() { Name = "BMW X6", Age = 3 } }; var userDto = user.TranslateTo<UserDto>(); Assert.That(userDto.FirstName, Is.EqualTo(user.FirstName)); Assert.That(userDto.LastName, Is.EqualTo(user.LastName)); Assert.That(userDto.Car, Is.EqualTo("{Name:BMW X6,Age:3}")); }
public void Does_translate_to_inherited_propeties() { var user = new User { FirstName = "Demis", LastName = "Bellot", Car = new Car { Name = "BMW X6", Age = 3 } }; var to = user.TranslateTo <SubUserFields>(); Assert.That(to.FirstName, Is.EqualTo(user.FirstName)); Assert.That(to.LastName, Is.EqualTo(user.LastName)); Assert.That(to.Car.Name, Is.EqualTo(user.Car.Name)); Assert.That(to.Car.Age, Is.EqualTo(user.Car.Age)); }
public void Does_translate() { var user = new User() { FirstName = "Demis", LastName = "Bellot", Car = new Car() { Name = "BMW X6", Age = 3 } }; var userDto = user.TranslateTo <UserDto>(); Assert.That(userDto.FirstName, Is.EqualTo(user.FirstName)); Assert.That(userDto.LastName, Is.EqualTo(user.LastName)); Assert.That(userDto.Car, Is.EqualTo("{Name:BMW X6,Age:3}")); }
public void Does_translate_to_inherited_propeties() { var user = new User { FirstName = "Demis", LastName = "Bellot", Car = new Car { Name = "BMW X6", Age = 3 } }; var to = user.TranslateTo<SubUserFields>(); Assert.That(to.FirstName, Is.EqualTo(user.FirstName)); Assert.That(to.LastName, Is.EqualTo(user.LastName)); Assert.That(to.Car.Name, Is.EqualTo(user.Car.Name)); Assert.That(to.Car.Age, Is.EqualTo(user.Car.Age)); }