public void GetContactsTestShouldThrowException()
        {
            var harness = new DomainTestHarness();

             harness.SetupGetCollectionForContactsToThrowException(new ArgumentNullException("collectionName", "A required parameter was null or empty"));

             var service = harness.GetContactService();
             var response = service.GetContacts();
             response.Success.Should().BeFalse();
             response.Errors.Count().Should().Be(1);
             harness.ContactRepository.Verify();
        }
        public void GetContactsTestShouldBeEmpty()
        {
            var harness = new DomainTestHarness();

             harness.SetupGetCollectionForContacts(null);

             var service = harness.GetContactService();
             var response = service.GetContacts();
             response.Success.Should().BeTrue();
             response.Collection.Should().BeNull();
             harness.ContactRepository.Verify();
        }
Пример #3
0
        public void GetContactsTestShouldThrowException()
        {
            var harness = new DomainTestHarness();

            harness.SetupGetCollectionForContactsToThrowException(new ArgumentNullException("collectionName", "A required parameter was null or empty"));

            var service  = harness.GetContactService();
            var response = service.GetContacts();

            response.Success.Should().BeFalse();
            response.Errors.Count().Should().Be(1);
            harness.ContactRepository.Verify();
        }
Пример #4
0
        public void GetContactsTestShouldBeEmpty()
        {
            var harness = new DomainTestHarness();

            harness.SetupGetCollectionForContacts(null);

            var service  = harness.GetContactService();
            var response = service.GetContacts();

            response.Success.Should().BeTrue();
            response.Collection.Should().BeNull();
            harness.ContactRepository.Verify();
        }
        public void GetContactsTestShouldPass()
        {
            var harness = new DomainTestHarness();

             var collection = harness.Fixture.CreateMany<Contact>().ToList();
             harness.SetupGetCollectionForContacts(collection);

             var service = harness.GetContactService();
             var response = service.GetContacts();
             response.Success.Should().BeTrue();
             response.Collection.Should().NotBeNullOrEmpty();
             response.Collection.Count().Should().Be(collection.Count());
             harness.ContactRepository.Verify();
        }
Пример #6
0
        public void GetContactsTestShouldPass()
        {
            var harness = new DomainTestHarness();

            var collection = harness.Fixture.CreateMany <Contact>().ToList();

            harness.SetupGetCollectionForContacts(collection);

            var service  = harness.GetContactService();
            var response = service.GetContacts();

            response.Success.Should().BeTrue();
            response.Collection.Should().NotBeNullOrEmpty();
            response.Collection.Count().Should().Be(collection.Count());
            harness.ContactRepository.Verify();
        }
        public void GetContactsTestShouldHaveAnonymousContacts()
        {
            var harness = new DomainTestHarness();

             var collection = harness.Fixture.CreateMany<Contact>(6).ToList();
             collection[1].Identifiers = null;
             collection[2].Identifiers = null;
             collection[4].Identifiers = null;
             harness.SetupGetCollectionForContacts(collection);

             var service = harness.GetContactService();
             var response = service.GetContacts();
             response.Success.Should().BeTrue();
             response.Collection.Where(c => c.FirstName == "Anonymous").Count().Should().Be(3);
             harness.ContactRepository.Verify();
        }
Пример #8
0
        public void GetContactsTestShouldHaveAnonymousContacts()
        {
            var harness = new DomainTestHarness();

            var collection = harness.Fixture.CreateMany <Contact>(6).ToList();

            collection[1].Identifiers = null;
            collection[2].Identifiers = null;
            collection[4].Identifiers = null;
            harness.SetupGetCollectionForContacts(collection);

            var service  = harness.GetContactService();
            var response = service.GetContacts();

            response.Success.Should().BeTrue();
            response.Collection.Where(c => c.FirstName == "Anonymous").Count().Should().Be(3);
            harness.ContactRepository.Verify();
        }