Exemplo n.º 1
0
        public void ReturnsTrueWithUniqueClientName()
        {
            var repository    = new ClientInMemoryRepository();
            var specification = new ContactEmailUniqueSpecification(repository);

            Client client = new Client("Client", "John Doe", "1234567890", "*****@*****.**");

            Assert.IsTrue(specification.IsSatisifiedBy(client));
        }
Exemplo n.º 2
0
        public void ReturnsTrueWithDuplicateExistingClient()
        {
            var repository    = new ClientInMemoryRepository();
            var specification = new ContactEmailUniqueSpecification(repository);

            Client client = new Client("Client", "John Doe", "1234567890", "*****@*****.**");

            repository.Store(client);

            Assert.IsTrue(specification.IsSatisifiedBy(client));
        }
Exemplo n.º 3
0
        public void ReturnsFalseWithDuplicateUniqueClient()
        {
            var repository    = new ClientInMemoryRepository();
            var specification = new ContactEmailUniqueSpecification(repository);

            Client client = new Client("Client 1", "John Doe", "1234567890", "*****@*****.**");

            repository.Store(client);
            Client duplicateClient = new Client("Client 2", "John Doe", "1234567890", "*****@*****.**");

            Assert.IsFalse(specification.IsSatisifiedBy(duplicateClient));
        }