public void TestConstructor()
 {
   using(DummyRepositoryConnection connection = new DummyRepositoryConnection())
   {
     UnitOfWork work = new UnitOfWork(connection);
     work.PerformWork();
   }
 }
 public void TestConstructor()
 {
     using (DummyRepositoryConnection connection = new DummyRepositoryConnection())
     {
         UnitOfWork work = new UnitOfWork(connection);
         work.PerformWork();
     }
 }
 public void TestRegister()
 {
   using(DummyRepositoryConnection connection = new DummyRepositoryConnection())
   {
     UnitOfWork work = new UnitOfWork(connection);
     
     Person person = new Person();
     work.Register(person);
     work.PerformWork();
     
     Assert.AreEqual("Create entity '[CSF.Patterns.DDD.Mocks.Entities.Person: no identity]'\n",
                     connection.Log.ToString(),
                     "Correct log message");
   }
 }
        public void TestRegister()
        {
            using (DummyRepositoryConnection connection = new DummyRepositoryConnection())
            {
                UnitOfWork work = new UnitOfWork(connection);

                Person person = new Person();
                work.Register(person);
                work.PerformWork();

                Assert.AreEqual("Create entity '[CSF.Patterns.DDD.Mocks.Entities.Person: no identity]'\n",
                                connection.Log.ToString(),
                                "Correct log message");
            }
        }
 public void TestPerformWork()
 {
   using(DummyRepositoryConnection connection = new DummyRepositoryConnection())
   {
     UnitOfWork work = new UnitOfWork(connection);
     
     Person personOne = new Person();
     personOne.RegisterUnitOfWork(work);
     personOne.Name = "Joe";
     personOne.TelephoneNumber = "98765";
     
     Person personTwo = new Person(5);
     personTwo.RegisterUnitOfWork(work);
     personTwo.Name = "Bob";
     personTwo.TelephoneNumber = "12345";
     
     work.PerformWork();
     
     Assert.AreEqual("Create entity '[CSF.Patterns.DDD.Mocks.Entities.Person: no identity]'\n" +
                     "Update entity '[CSF.Patterns.DDD.Mocks.Entities.Person: 5]'\n",
                     connection.Log.ToString(),
                     "Correct log message");
   }
 }
        public void TestPerformWork()
        {
            using (DummyRepositoryConnection connection = new DummyRepositoryConnection())
            {
                UnitOfWork work = new UnitOfWork(connection);

                Person personOne = new Person();
                personOne.RegisterUnitOfWork(work);
                personOne.Name            = "Joe";
                personOne.TelephoneNumber = "98765";

                Person personTwo = new Person(5);
                personTwo.RegisterUnitOfWork(work);
                personTwo.Name            = "Bob";
                personTwo.TelephoneNumber = "12345";

                work.PerformWork();

                Assert.AreEqual("Create entity '[CSF.Patterns.DDD.Mocks.Entities.Person: no identity]'\n" +
                                "Update entity '[CSF.Patterns.DDD.Mocks.Entities.Person: 5]'\n",
                                connection.Log.ToString(),
                                "Correct log message");
            }
        }