Exemple #1
0
        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));
        }
Exemple #2
0
        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();
        }