public void Beer_AllPropertiesMap(DaBeerStorage.Functions.Untappd.Models.BeerInfo.Beer beer) { var viewModel = SearchViewModel.FromBeerModel(beer); viewModel.Brewery.ShouldBe(beer.Brewery.BreweryName); viewModel.BeerName.ShouldBe(beer.BeerName); viewModel.Description.ShouldBe(beer.BeerDescription); viewModel.LabelPath.ShouldBe(beer.BeerLabel.AbsoluteUri); viewModel.Ibu.ShouldBe(beer.BeerIbu.ToString()); viewModel.BreweryState.ShouldBe(beer.Brewery.Location.BreweryState); viewModel.Rating.ShouldBe(beer.AuthRating.ToString()); }
public static SearchViewModel FromBeerModel(DaBeerStorage.Functions.Untappd.Models.BeerInfo.Beer beer) { return(new SearchViewModel() { Brewery = beer.Brewery.BreweryName, Description = beer.BeerDescription, BeerName = beer.BeerName, LabelPath = beer.BeerLabel.AbsoluteUri, Ibu = beer.BeerIbu.ToString(), Rating = beer.AuthRating.ToString(), BreweryState = beer.Brewery.Location.BreweryState }); }
public void Beer_All_Properties_Should_Have_A_Value(DaBeerStorage.Functions.Untappd.Models.BeerInfo.Beer beer) { var viewModel = SearchViewModel.FromBeerModel(beer); VerifyMappings(viewModel); }