public void MapFromCollection_Should_ReturnCorrectCountBarRatings() { //Arrange var sut = new BarRatingViewModelMapper(); var barRating = new List <BarRatingDto> { new BarRatingDto { Value = 5, BarId = Guid.NewGuid(), UserId = Guid.NewGuid(), UserName = "******", CreatedOn = DateTime.MinValue, }, new BarRatingDto { Value = 4, BarId = Guid.NewGuid(), UserId = Guid.NewGuid(), UserName = "******", CreatedOn = DateTime.MinValue, }, }; //Act var result = sut.MapFrom(barRating); //Assert Assert.AreEqual(2, result.Count()); }
public void MapFrom_Should_ReturnCorrectInstanceOfCollection_BarRatingDto() { //Arrange var sut = new BarRatingViewModelMapper(); var barRating = new List <BarRatingDto> { new BarRatingDto { Value = 5, BarId = Guid.NewGuid(), UserId = Guid.NewGuid(), UserName = "******", CreatedOn = DateTime.MinValue, }, new BarRatingDto { Value = 4, BarId = Guid.NewGuid(), UserId = Guid.NewGuid(), UserName = "******", CreatedOn = DateTime.MinValue, }, }; //Act var result = sut.MapFrom(barRating); //Assert Assert.IsInstanceOfType(result, typeof(List <BarRatingViewModel>)); }
public void MapFrom_Should_ReturnCorrectInstanceOf_BarRatingViewModel() { //Arrange var sut = new BarRatingViewModelMapper(); var barRating = new BarRatingDto { UserId = Guid.NewGuid(), UserName = "******", BarId = Guid.NewGuid(), CreatedOn = DateTime.Now, Value = 4, }; //Act var result = sut.MapFrom(barRating); //Assert Assert.IsInstanceOfType(result, typeof(BarRatingViewModel)); }
public void MapFrom_Should_CorrectlyMapFrom_BarRatingDto_To_BarRatingViewModel() { //Arrange var sut = new BarRatingViewModelMapper(); var barRating = new BarRatingDto { UserId = Guid.NewGuid(), UserName = "******", BarId = Guid.NewGuid(), CreatedOn = DateTime.Now, Value = 4, }; //Act var result = sut.MapFrom(barRating); //Assert Assert.AreEqual(result.Value, barRating.Value); Assert.AreEqual(result.BarId, barRating.BarId); Assert.AreEqual(result.UserId, barRating.UserId); Assert.AreEqual(result.UserName, barRating.UserName); Assert.AreEqual(result.CreatedOn, barRating.CreatedOn); }