コード例 #1
0
        public void ToggleItem_WhenSpecifyingName_TogglesIsDoneProperty()
        {
            // Arrange
            ITodoListManager manager = new TodoListManager();

            manager.AddItem("test-item");

            // Act
            manager.ToggleItem("test-item");

            // Assert
            Assert.That(manager.CompletedItems, Is.EquivalentTo(new[]
            {
                "test-item"
            }));
        }
コード例 #2
0
        public void AddItem_WhenSpecifyingName_CreatesNewTodoListItem()
        {
            // Arrange
            ITodoListManager manager = new TodoListManager();

            // Act
            manager.AddItem("test-item");

            // Assert
            var result = manager.Items;

            // Assert.IsTrue(result.SequenceEqual(new[] { "test-item" }));
            Assert.That(result, Is.EquivalentTo(new[]
            {
                "test-item"
            }));
        }
コード例 #3
0
        public void ToggleItem_WhenSpecifyingName_TogglesIsDoneProperty()
        {
            // Arrange
            ITodoListManager manager = new TodoListManager();
            manager.AddItem("test-item");

            // Act
            manager.ToggleItem("test-item");

            // Assert
            Assert.That(manager.CompletedItems, Is.EquivalentTo(new[]
            {
                "test-item"
            }));
        }
コード例 #4
0
        public void AddItem_WhenSpecifyingName_CreatesNewTodoListItem()
        {
            // Arrange
            ITodoListManager manager = new TodoListManager();

            // Act
            manager.AddItem("test-item");

            // Assert
            var result = manager.Items;
            // Assert.IsTrue(result.SequenceEqual(new[] { "test-item" }));
            Assert.That(result, Is.EquivalentTo(new[]
            {
                "test-item"
            }));
        }