Exemplo n.º 1
0
        public void IsEmpty_WhenTheSameNumberOfItemsHaveBeenRemovedAsWereAdded_ShouldReturnTrue()
        {
            // Arrange
            var subject = new BreadthFirstSearchFringe<TestState>();

            subject.Add(new TestState());
            subject.Add(new TestState());
            subject.Add(new TestState());

            subject.GetNext();
            subject.GetNext();
            subject.GetNext();

            // Act
            var result = subject.IsEmpty();

            // Assert
            Assert.True(result);
        }
Exemplo n.º 2
0
        public void IsEmpty_AfterMoreItemsHaveBeenAddedThanRemoved_ShouldReturnFalse()
        {
            // Arrange
            var subject = new BreadthFirstSearchFringe<TestState>();

            subject.Add(new TestState());
            subject.Add(new TestState());
            subject.Add(new TestState());

            subject.GetNext();
            subject.GetNext();

            // Act
            var result = subject.IsEmpty();

            // Assert
            Assert.False(result);
        }
Exemplo n.º 3
0
        public void IsEmpty_StraightAfterCreation_ShouldReturnTrue()
        {
            // Arrange
            var subject = new BreadthFirstSearchFringe<TestState>();

            // Act
            var result = subject.IsEmpty();

            // Assert
            Assert.True(result);
        }