コード例 #1
0
        public void GroupBy_BeforeFirst(string territoryId)
        {
            // Arrange
            var territories = new EnumerableQuery <Territories>(
                new List <Territories>
            {
                new Territories
                {
                    TerritoryID          = "02903",
                    TerritoryDescription = "Providence",
                    RegionID             = 1,
                    Region = new Region {
                        RegionID = 1, RegionDescription = "Eastern"
                    }
                }
            });

            // Act
            var result = territories.GetRegionByTerritoryIdWithFirstBefore(territoryId);

            // Assert
            result.ShouldBeEquivalentTo(new Region {
                RegionID = 1, RegionDescription = "Eastern"
            });
        }