Exemplo n.º 1
0
        public void FindCustomerContactsShouldBeDistinct()
        {
            var expectedContacts = new[]
            {
                new CustomerContact {
                    PrimaryKeyId = new PrimaryKeyId(1)
                },
                new CustomerContact {
                    PrimaryKeyId = new PrimaryKeyId(2)
                }
            };
            var dataLoader = A.Fake <IVippsLoginDataLoader>();

            A.CallTo(() => dataLoader.FindContactsByEmail(A <string> ._))
            .Returns(expectedContacts);
            A.CallTo(() => dataLoader.FindContactsByPhone(A <string> ._))
            .Returns(expectedContacts);

            var service = new VippsLoginCommerceService(
                A.Fake <IVippsLoginService>(),
                A.Fake <IVippsLoginMapper>(),
                dataLoader,
                A.Fake <ICustomerContactService>());

            var contacts = service.FindCustomerContacts(string.Empty, string.Empty);

            Assert.Equal(expectedContacts, contacts);
        }
Exemplo n.º 2
0
        public void FindCustomerContactsShouldBeEmpty()
        {
            var service = new VippsLoginCommerceService(
                A.Fake <IVippsLoginService>(),
                A.Fake <IVippsLoginMapper>(),
                A.Fake <IVippsLoginDataLoader>(),
                A.Fake <ICustomerContactService>());

            var contact = service.FindCustomerContacts(string.Empty, string.Empty);

            Assert.Empty(contact);
        }