예제 #1
0
        public void WriteBinaryFile_path_to_directory_throws_FileExpectedException()
        {
            var fileSystemMock = new MockCommonFileSystemWriteFile();

            fileSystemMock.SetPathExistance(_testPath, MockCommonFileSystem.PathExistance.Directory);

            fileSystemMock.WriteBinaryFile(_testPath, new byte[] { 1, 2, 3 });
        }
예제 #2
0
        private void TestWriteBinaryFile(MockCommonFileSystemWriteFile fileSystemMock)
        {
            var data = new byte[] { 1, 2, 3, 4, 5, 6 };

            fileSystemMock.WriteBinaryFile(_testPath, data, false);
            Assert.That(fileSystemMock.Called);
            AssertPath(fileSystemMock.Path);
            Assert.AreEqual(data, fileSystemMock.Data);
        }