public void AgentRepositoryTest()
        {
            AgentRepository repository = new AgentRepository();
            Agent expectedAgent = new Agent(repository.GetAll().Count() + 1, "agensomeagent");

            repository.Add(expectedAgent);

            Agent realAgent = repository.GetItem(expectedAgent.id);

            Assert.AreEqual(expectedAgent, realAgent);

            repository.Delete(expectedAgent);

            realAgent = repository.GetItem(expectedAgent.id);

            Assert.AreEqual(null, realAgent);
        }
예제 #2
0
        public void AgentRepositoryTest()
        {
            AgentRepository repository    = new AgentRepository();
            Agent           expectedAgent = new Agent(repository.GetAll().Count() + 1, "agensomeagent");

            repository.Add(expectedAgent);


            Agent realAgent = repository.GetItem(expectedAgent.id);

            Assert.AreEqual(expectedAgent, realAgent);

            repository.Delete(expectedAgent);


            realAgent = repository.GetItem(expectedAgent.id);

            Assert.AreEqual(null, realAgent);
        }