public void DsfDropBoxDeleteActivity_DropBoxSource_Same_Object_Is_Equal() { //---------------Set up test pack------------------- var uniqueId = Guid.NewGuid().ToString(); var mockDropboxClient = new Mock <IDropboxClient>(); var mockDropboxClientFactory = new Mock <IDropboxClientFactory>(); mockDropboxClientFactory.Setup(o => o.New(It.IsAny <string>(), It.IsAny <HttpClient>())).Returns(mockDropboxClient.Object); using (var dropBoxDeleteActivity = new DsfDropBoxDeleteActivityMock(mockDropboxClientFactory.Object) { UniqueID = uniqueId, Result = "A" }) { dropBoxDeleteActivity.SetupDropboxClient(""); var dropBoxDeleteActivity1 = new DsfDropBoxDeleteActivity { UniqueID = uniqueId, Result = "A" }; //---------------Assert Precondition---------------- Assert.IsTrue(dropBoxDeleteActivity.Equals(dropBoxDeleteActivity1)); //---------------Execute Test ---------------------- dropBoxDeleteActivity.SelectedSource = new DropBoxSource(); dropBoxDeleteActivity1.SelectedSource = new DropBoxSource(); var @equals = dropBoxDeleteActivity.Equals(dropBoxDeleteActivity1); //---------------Test Result ----------------------- Assert.IsTrue(equals); } }
public void DsfDropBoxDeleteActivity_Equals_IsNull_ExpectFalse() { //-----------------------Arrange---------------------------- var mockDropboxClient = new Mock <IDropboxClient>(); var mockDropboxClientFactory = new Mock <IDropboxClientFactory>(); mockDropboxClientFactory.Setup(o => o.New(It.IsAny <string>(), It.IsAny <HttpClient>())).Returns(mockDropboxClient.Object); using (var dsfDropBoxDeleteAcivtity = new DsfDropBoxDeleteActivityMock(mockDropboxClientFactory.Object)) { dsfDropBoxDeleteAcivtity.SetupDropboxClient(""); //-----------------------Act-------------------------------- //-----------------------Assert----------------------------- Assert.IsFalse(dsfDropBoxDeleteAcivtity.Equals(null)); } }