コード例 #1
0
        public void Delete_WhenNameIsRootDirectory_ShouldThrowException()
        {
            // Arrange
            _entryRepositoryMock
            .Setup(r => r.Exists(PathConstants.RootDirectoryName))
            .Returns(true);

            // Act
            void Act() => _client.Delete(PathConstants.RootDirectoryName);

            // Assert
            Assert.Throws <ArgumentNonValidException>(Act);
        }
コード例 #2
0
        public void Delete_WithValidParameters_ShouldDeleteFile(string fileName)
        {
            // Arrange
            _entryRepositoryMock
            .Setup(r => r.Exists(fileName))
            .Returns(true);

            // Act
            _client.Delete(fileName);

            // Assert
            _entryRepositoryMock.Verify(r => r.Delete(fileName));
        }