public void And_OrderBy_Score_Then_Ordered_By_Score_Then_By_Title_Then_By_Level( string keyword, StandardsSortOrderService standardsSortOrderService) { //Arrange var orderBy = OrderBy.Score; var standards = new List <Standard> { new Standard { LarsCode = 1, SearchScore = 1, Title = "aardvark", Level = 3, LarsStandard = new LarsStandard() }, new Standard { LarsCode = 2, SearchScore = 1, Title = "aardvark", Level = 1, LarsStandard = new LarsStandard() }, new Standard { LarsCode = 3, SearchScore = 1, Title = "aardvark", Level = 2, LarsStandard = new LarsStandard() } }; //Act var actual = standardsSortOrderService.OrderBy(standards, orderBy, keyword); //Assert Assert.AreEqual(2, actual.ElementAt(0).LarsCode); Assert.AreEqual(3, actual.ElementAt(1).LarsCode); Assert.AreEqual(1, actual.ElementAt(2).LarsCode); }
public void And_OrderBy_Title_Then_Ordered_By_Title_Then_By_Level_Then_By_LarsStandard( StandardsSortOrderService standardsSortOrderService) { //Arrange var orderBy = OrderBy.Title; var standards = new List <Standard> { new Standard { LarsCode = 1, Title = "aardvark", Level = 3, LarsStandard = new LarsStandard { LarsCode = 6 } }, new Standard { LarsCode = 2, Title = "aardvark", Level = 3, LarsStandard = new LarsStandard { LarsCode = 4 } }, new Standard { LarsCode = 3, Title = "aardvark", Level = 3, LarsStandard = new LarsStandard { LarsCode = 5 } } }; //Act var actual = standardsSortOrderService.OrderBy(standards, orderBy, null); //Assert Assert.AreEqual(2, actual.ElementAt(0).LarsCode); Assert.AreEqual(3, actual.ElementAt(1).LarsCode); Assert.AreEqual(1, actual.ElementAt(2).LarsCode); }