コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }