public void HasIncludes_WhenEmptyIncludes_ReturnsFalse() { var cmd = new Query(StructureSchemaTestFactory.Stub()); cmd.Includes.Clear(); Assert.IsFalse(cmd.HasIncludes); }
public void HasSortings_WhenSelectExists_ReturnsTrue() { var sortingsFake = new Mock<IParsedLambda>(); sortingsFake.Setup(f => f.Nodes).Returns(GetFakeNodes(1)); var cmd = new Query(StructureSchemaTestFactory.Stub()) { Sortings = sortingsFake.Object }; Assert.IsTrue(cmd.HasSortings); }
public void HasWhere_WhenWhereExists_ReturnsTrue() { var whereFake = new Mock<IParsedLambda>(); whereFake.Setup(f => f.Nodes).Returns(GetFakeNodes(1)); var cmd = new Query(StructureSchemaTestFactory.Stub()) { Where = whereFake.Object }; Assert.IsTrue(cmd.HasWhere); }
public void HasIncludes_WhenIncludesExists_ReturnsTrue() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Includes = new List<IParsedLambda> { new Mock<IParsedLambda>().Object } }; Assert.IsTrue(cmd.HasIncludes); }
public void IsEmpty_WhenWhereButNothingElse_ReturnsFalse() { var whereFake = new Mock<IParsedLambda>(); whereFake.Setup(f => f.Nodes).Returns(GetFakeNodes(1)); var query = new Query(StructureSchemaTestFactory.Stub()) { Where = whereFake.Object }; Assert.IsFalse(query.IsEmpty); }
public void IsEmpty_WhenEmpty_ReturnsTrue() { var query = new Query(StructureSchemaTestFactory.Stub()); Assert.IsTrue(query.IsEmpty); }
public void HasSortings_WhenNullSortingsExists_ReturnsFalse() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Sortings = null }; Assert.IsFalse(cmd.HasSortings); }
public void HasWhere_WhenNullWhereExists_ReturnsFalse() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Where = null }; Assert.IsFalse(cmd.HasWhere); }
public void HasPaging_WhenPagingExists_ReturnsTrue() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Paging = new Paging(0, 1) }; Assert.IsTrue(cmd.HasPaging); }
public void HasPaging_WhenNullPagingExists_ReturnsFalse() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Paging = null }; Assert.IsFalse(cmd.HasPaging); }
public void IsEmpty_WhenSkipButNothingElse_ReturnsFalse() { var query = new Query(StructureSchemaTestFactory.Stub()) { SkipNumOfStructures = 1 }; Assert.IsFalse(query.IsEmpty); }
public void IsEmpty_WhenPagingButNothingElse_ReturnsFalse() { var query = new Query(StructureSchemaTestFactory.Stub()) { Paging = new Paging(0, 1) }; Assert.IsFalse(query.IsEmpty); }
public void HasIncludes_WhenNullIncludes_ReturnsFalse() { var cmd = new Query(StructureSchemaTestFactory.Stub()) { Includes = null }; Assert.IsFalse(cmd.HasIncludes); }
public void IsEmpty_WhenNoWhereSortingOrIncludes_ReturnsTrue() { var query = new Query(StructureSchemaTestFactory.Stub()); Assert.IsTrue(query.IsEmpty); }
public void IsEmpty_WhenIncludesButNothingElse_ReturnsFalse() { var includesFake = new Mock<IParsedLambda>(); includesFake.Setup(f => f.Nodes).Returns(GetFakeNodes(1)); var query = new Query(StructureSchemaStubFactory.Stub()) { Includes = new []{ includesFake.Object } }; Assert.IsFalse(query.IsEmpty); }