public void CreateNewdropboxFileRead_GivenPath_ShouldBeValid() { //---------------Set up test pack------------------- var dropboxFileRead = new DropboxFileRead(true, "a.file", false, false); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- //---------------Test Result ----------------------- Assert.IsNotNull(dropboxFileRead); }
public void ExecuteDropboxFileRead_Throws_ShouldReturnFailedResult() { //---------------Set up test pack------------------- var dropBoxFileRead = new DropboxFileRead(true, null, false, false); var mockDropboxClient = new Mock <IDropboxClientWrapper>(); mockDropboxClient.Setup(client => client.ListFolderAsync(It.IsAny <ListFolderArg>())).Throws(new Exception()); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var result = dropBoxFileRead.ExecuteTask(mockDropboxClient.Object); //---------------Test Result ----------------------- Assert.IsInstanceOfType(result, typeof(DropboxFailureResult), "Dropbox failure result not returned after exception"); }
public void CreateNewdropboxFileRead_GivenNullPath_ShouldBeValid() { //---------------Set up test pack------------------- var dropboxFileRead = new DropboxFileRead(true, null, false, false); PrivateObject type = new PrivateObject(dropboxFileRead); var staticField = type.GetField("_path", BindingFlags.Instance | BindingFlags.NonPublic); //---------------Assert Precondition---------------- Assert.IsNotNull(dropboxFileRead); Assert.IsNotNull(staticField); //---------------Execute Test ---------------------- //---------------Test Result ----------------------- Assert.IsNotNull(staticField); Assert.AreEqual("", ""); }