public void AddBlock_Always_InvokesAddBlock() { // Arrange var mockClientProtocol = new Mock <IClientProtocol>(); mockClientProtocol.Setup(x => x.AddBlock("filePath")); var controller = new ClientProtocolController(mockClientProtocol.Object); // Act controller.AddBlock("filePath"); // Assert mockClientProtocol.VerifyAll(); }
public void Mkdir_Always_InvokesMkdir() { // Arrange var mockClientProtocol = new Mock <IClientProtocol>(); mockClientProtocol.Setup(x => x.Mkdir("directoryPath")); var controller = new ClientProtocolController(mockClientProtocol.Object); // Act controller.Mkdir("directoryPath"); // Assert mockClientProtocol.VerifyAll(); }
public void Create_Always_InvokesCreate() { // Arrange var mockClientProtocol = new Mock <IClientProtocol>(); mockClientProtocol.Setup(x => x.Create("srcFile", "filePath")); var controller = new ClientProtocolController(mockClientProtocol.Object); // Act controller.Create("srcFile", "filePath"); // Assert mockClientProtocol.VerifyAll(); }
public void GetListing_Always_InvokesGetListing() { // Arrange var mockClientProtocol = new Mock <IClientProtocol>(); var listing = new List <CdfsFileStatus> { new CdfsFileStatus() }; mockClientProtocol.Setup(x => x.GetListing("filePath")).Returns(listing); var controller = new ClientProtocolController(mockClientProtocol.Object); // Act var result = controller.GetListing("filePath"); // Assert CollectionAssert.AreEqual(listing, result); mockClientProtocol.VerifyAll(); }