public void SortExpression_ReturnsCorrectString(string name, SortDirection sort, string expectedResult) { // Arrange var expression = new SortExpression(name, sort); // Act var expressionString = expression.ToString(); // Assert Assert.AreEqual(expectedResult, expressionString); }
public void SortExpression_ToString_WithTwoColumns_HasHasBothColumnsInOutput() { var sort = new SortExpression<TestClass>(prop => prop.IntProp, prop => prop.StringProp); Assert.Contains("intprop,stringprop", sort.ToString()); }
public void SortExpression_ToString_WithOneColumn_HasHasColumnNameInOutput() { var sort = new SortExpression<TestClass>(prop => prop.IntProp); Assert.Contains("intprop", sort.ToString()); }
public void SortExpression_ToString_WithDescending_HasHasDescendingIndicatorInOutput() { var sort = new SortExpression<TestClass>(true, prop => prop.IntProp); Assert.Contains(ParserConstants.DescendingIndicator, sort.ToString()); }
public void SortExpression_WithTwoColumns_ToString_ContainsSortPrefix() { var sort = new SortExpression<TestClass>(prop => prop.IntProp, prop => prop.StringProp); Assert.True(sort.ToString().StartsWith(ParserConstants.SortIndicator)); }