Esempio n. 1
0
        public void GetTest()
        {
            var manager = new ClientManager();
            var client = new Client { Id = Guid.NewGuid(), Name = "Qwest", Projects = new List<Project> { new Project { Id = Guid.NewGuid(), Name = "Connect" } } };
            manager.Create(client);

            var clientCreated = manager.Get(client.Id);
            Assert.IsNotNull(clientCreated);
            Assert.AreEqual(clientCreated.Id, client.Id);
        }
Esempio n. 2
0
        public void GetAllTest()
        {
            var manager = new ClientManager();
            var client = new Client { Id = Guid.NewGuid(), Name = "Qwest", Projects = new List<Project> { new Project { Id = Guid.NewGuid(), Name = "Connect" } } };
            manager.Create(client);

            var clients = manager.GetAll();
            Assert.IsNotNull(clients);
            Assert.IsTrue(clients.Count() > 0);
        }
Esempio n. 3
0
        public void UpdateTest()
        {
            var manager = new ClientManager();
            var client = new Client { Id = Guid.NewGuid(), Name = "Qwest", Projects = new List<Project> { new Project { Id = Guid.NewGuid(), Name = "Connect" } } };
            manager.Create(client);

            client.Projects.Add(new Project { Id = Guid.NewGuid(), Name = "test add" });
            client.Projects.FirstOrDefault().Name = "edited";
            client.Name = "edites";

            bool actual = manager.Update(client);
            Assert.AreEqual(true, actual);
            Assert.AreEqual(client.Name, "edites");
        }
Esempio n. 4
0
 public void SaveTest()
 {
     ClientManager target = new ClientManager();
     Client client = new Client{ Id = Guid.NewGuid(), Name = "Qwest", Projects = new List<Project>{new Project{ Id = Guid.NewGuid(), Name = "Connect"}}};
     bool expected = true; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.Create(client);
     Assert.AreEqual(expected, actual);
 }