Beispiel #1
0
        public void getAllClients_ShouldReturnAllClients()
        {
            string        dbPath;
            List <Client> clientList;

            dbPath     = Constants.TEST_DB_PATH;
            clientList = new ClientRepositoryImpl(dbPath).getClients();

            Assert.AreEqual(clientList.Count, 194);
        }
Beispiel #2
0
        public void getClientbyid_not_found_ShouldReturnNull()
        {
            string dbPath;
            Client client;
            string id;

            id     = "fake id";
            dbPath = Constants.TEST_DB_PATH;
            client = new ClientRepositoryImpl(dbPath).getClientsById(id);

            Assert.IsNull(client);
        }
Beispiel #3
0
        public void getClientByName()
        {
            string dbPath;
            string name;
            string mail;

            name   = "Julia";
            mail   = "*****@*****.**";
            dbPath = Constants.TEST_DB_PATH;
            var listClient = new ClientRepositoryImpl(dbPath).getClientsByName(name);

            Assert.IsNotNull(listClient);
            Assert.AreEqual(listClient.Count, 1);
            Assert.AreEqual(listClient[0].name, name);
            Assert.AreEqual(listClient[0].email, mail);
        }
Beispiel #4
0
        public void getClientbyid_ShouldReturnAClient()
        {
            string dbPath;
            Client client;
            string id;
            string expectedName;
            string expectedMail;

            expectedName = "Bethany";
            expectedMail = "*****@*****.**";
            id           = "2dbaac64-c13b-4d02-a980-e03627dee50d";
            dbPath       = Constants.TEST_DB_PATH;
            client       = new ClientRepositoryImpl(dbPath).getClientsById(id);

            Assert.AreEqual(client.name, expectedName);
            Assert.AreEqual(client.email, expectedMail);
        }
Beispiel #5
0
        public void getClientByPolicy()
        {
            string dbPath;
            Client client;
            string policyId;
            string expectedClienId;
            string expectedClienName;

            expectedClienId   = "e8fd159b-57c4-4d36-9bd7-a59ca13057bb";
            policyId          = "3a774f4e-0e70-488f-ac9f-ee211c8d5ece";
            expectedClienName = "Manning";
            dbPath            = Constants.TEST_DB_PATH;
            client            = new ClientRepositoryImpl(dbPath).getClientByPolicy(policyId);

            Assert.IsNotNull(client);
            Assert.AreEqual(client.id, expectedClienId);
            Assert.AreEqual(client.name, expectedClienName);
        }
Beispiel #6
0
 //Pour les tests unitaires
 public static ClientServiceImpl getClientServiceImpl()
 {
     return(new ClientServiceImpl(ClientRepositoryImpl.getRepositoryImpl()));
 }