예제 #1
0
        public void ShouldMapFields_WhenMapFromLocation(Location location, string pk)
        {
            var table = DaBeerStorageTable.MapFromLocation(location, pk);

            table.PK.ShouldBe(pk);
            table.SK.ShouldBe($"Location#{location.Name}");
            table.LocationName.ShouldBe(location.Name);
        }
예제 #2
0
        public void All_Beer_Properties_Should_Have_A_Value(DaBeerStorageTable table)
        {
            table.DrankWhen = DateTimeOffset.Now.ToString();

            var beer = table.MapToBeer();

            VerifyMappings(beer);
        }
예제 #3
0
        public void ShouldMapFields_WhenMapBeerFromTable(DaBeerStorageTable table)
        {
            var beer = table.MapToBeer();

            beer.Description.ShouldBe(table.BeerDescription);
            beer.Drank.ShouldBe(table.Drank);
            beer.Ibu.ShouldBe(table.Ibu);
            beer.Location.ShouldBe(table.LocationName);
            beer.Name.ShouldBe(table.BeerName);
            beer.Rating.ShouldBe(table.Rating);
            beer.Style.ShouldBe(table.Style);
            beer.BeerId.ShouldBe(table.BeerId);
            beer.BreweryName.ShouldBe(table.BreweryName);
            beer.BreweryState.ShouldBe(table.BreweryState);
            beer.DateAdded.ShouldBe(table.DateAdded);
            beer.DrankWhen.ShouldBe(table.DrankWhen);
            beer.LabelPath.ShouldBe(table.LabelPath);
            beer.Location.ShouldBe(table.LocationName);
            beer.UntappedId.ShouldBe(table.UntappedId);
            beer.AlchoholByVolume.ShouldBe(table.AlchoholByVolume);
            beer.BrewerDbId.ShouldBe(table.BrewerDbId);
        }
예제 #4
0
        public void ShouldMapField_WhenMapFromBeer(string pk, Beer beer)
        {
            var table = DaBeerStorageTable.MapFromBeer(beer, pk);

            table.PK.ShouldBe(pk);
            table.SK.ShouldBe($"Beer#{beer.BeerId}");
            table.BreweryKey.ShouldBe("Brewery#" + beer.BreweryName + "#" + beer.BeerId);
            table.Drank.ShouldBe(beer.Drank);
            table.Ibu.ShouldBe(beer.Ibu);
            table.Rating.ShouldBe(beer.Rating);
            table.Style.ShouldBe(beer.Style);
            table.BeerDescription.ShouldBe(beer.Description);
            table.BeerName.ShouldBe(beer.Name);
            table.BreweryName.ShouldBe(beer.BreweryName);
            table.BreweryState.ShouldBe(beer.BreweryState);
            table.DateAdded.ShouldBe(beer.DateAdded.DateTime);
            table.DrankWhen.ShouldBe(beer.DrankWhen);
            table.LabelPath.ShouldBe(beer.LabelPath);
            table.LocationName.ShouldBe(beer.Location);
            table.UntappedId.ShouldBe(beer.UntappedId);
            table.AlchoholByVolume.ShouldBe(beer.AlchoholByVolume);
            table.BrewerDbId.ShouldBe(beer.BrewerDbId);
        }
예제 #5
0
        public void All_Location_Properties_Should_Have_A_Value(DaBeerStorageTable table)
        {
            var location = table.MapToLocation();

            VerifyMappings(location);
        }
예제 #6
0
        public void ShouldMapFields_WhenMapLocationFromTable(DaBeerStorageTable table)
        {
            var location = table.MapToLocation();

            location.Name.ShouldBe(table.LocationName);
        }
예제 #7
0
        public void Beers_Should_MatchCount_WhenMapping_From_List(List <DaBeerStorageTable> beers)
        {
            var coreModels = DaBeerStorageTable.MapToBeers(beers);

            beers.Count.ShouldBe(coreModels.Count);
        }
예제 #8
0
        public void Locations_Should_MatchCount_WhenMapping_From_List(List <DaBeerStorageTable> locations)
        {
            var coreModels = DaBeerStorageTable.MapToLocations(locations);

            locations.Count.ShouldBe(coreModels.Count);
        }