/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public override bool Equals(IOAuthSource other) { if (other != null) { return(AppKey == other.AppKey && AccessToken == other.AccessToken); } return(false); }
public void TestToModelNullItem() { //arrange _manageOAuthSourceViewModel.Item = null; //act IOAuthSource result = _manageOAuthSourceViewModel.ToModel(); //assert Assert.IsNotNull(_manageOAuthSourceViewModel.Item); }
public void TestToModelOtherItem() { //arrange _manageOAuthSourceViewModel.Item = new DropBoxSource(); _manageOAuthSourceViewModel.SelectedOAuthProvider = "Other"; //act IOAuthSource result = _manageOAuthSourceViewModel.ToModel(); //assert Assert.IsNull(result); }
public void SaveOAuthSource(IOAuthSource source, Guid serverWorkspaceID) { var con = Connection; var comsController = CommunicationControllerFactory.CreateController("SaveOAuthSource"); var serialiser = new Dev2JsonSerializer(); comsController.AddPayloadArgument("OAuthSource", serialiser.SerializeToBuilder(source)); var output = comsController.ExecuteCommand <IExecuteMessage>(con, GlobalConstants.ServerWorkspaceID); if (output.HasError) { throw new WarewolfSaveException(output.Message.ToString(), null); } }
public void TestToModelDropBoxSourceItem() { //arrange _manageOAuthSourceViewModel.Item = new DropBoxSource(); _manageOAuthSourceViewModel.SelectedOAuthProvider = "Dropbox"; _manageOAuthSourceViewModel.AppKey = "123"; _manageOAuthSourceViewModel.AccessToken = "token"; //act IOAuthSource result = _manageOAuthSourceViewModel.ToModel(); //assert Assert.IsNotNull(_manageOAuthSourceViewModel.Item); Assert.AreEqual(result.AppKey, "123"); Assert.AreEqual(result.AccessToken, "token"); }
public void TestToModelNullItemNullOAuthSource() { //arrange Mock <IRequestServiceNameViewModel> requestServiceNameViewModel = new Mock <IRequestServiceNameViewModel>(); Task <IRequestServiceNameViewModel> requestServiceNameViewModelTask = new Task <IRequestServiceNameViewModel>(() => requestServiceNameViewModel.Object); _manageOAuthSourceViewModel = new ManageOAuthSourceViewModel(_updateManager.Object, requestServiceNameViewModelTask); _manageOAuthSourceViewModel.Item = null; _manageOAuthSourceViewModel.AppKey = "123"; _manageOAuthSourceViewModel.AccessToken = "token"; //act IOAuthSource result = _manageOAuthSourceViewModel.ToModel(); //assert Assert.IsNotNull(_manageOAuthSourceViewModel.Item); Assert.AreEqual(result.AccessToken, "token"); Assert.AreEqual(result.AppKey, "123"); }
public void Save(IOAuthSource sharePointServiceSource) => UpdateManagerProxy.SaveOAuthSource(sharePointServiceSource, GlobalConstants.ServerWorkspaceID);
public void TestManageOAuthSourceViewModelConstructorNullIOAuthSource() { IOAuthSource nullParam = null; new ManageOAuthSourceViewModel(_updateManager.Object, nullParam, new SynchronousAsyncWorker()); }
public void Save(IOAuthSource toDbSource) { _updateRepository.Save(toDbSource); }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public abstract bool Equals(IOAuthSource other);
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public override bool Equals(IOAuthSource other) { // ReSharper disable once PossibleNullReferenceException return(AppKey == other.AppKey && AccessToken == other.AccessToken); }
public void Save(IOAuthSource source) { UpdateManagerProxy.SaveOAuthSource(source, GlobalConstants.ServerWorkspaceID); }