public void RemoveLinkToVippsAccountThrowsIfNull() { var service = new VippsLoginCommerceService( A.Fake <IVippsLoginService>(), A.Fake <IVippsLoginMapper>(), A.Fake <IVippsLoginDataLoader>(), A.Fake <ICustomerContactService>()); Assert.Throws <ArgumentNullException>(() => service.RemoveLinkToVippsAccount(null)); }
public void RemoveLinkToVippsAccountShouldRemoveValue() { var customerContactService = A.Fake <ICustomerContactService>(); var service = new VippsLoginCommerceService( A.Fake <IVippsLoginService>(), A.Fake <IVippsLoginMapper>(), A.Fake <IVippsLoginDataLoader>(), customerContactService ); var contact = new CustomerContact(); contact.SetVippsSubject(Guid.NewGuid()); service.RemoveLinkToVippsAccount(contact); Assert.Null(contact.GetVippsSubject()); A.CallTo(() => customerContactService.SaveChanges(contact)).MustHaveHappened(); }