static void Main(string[] args)
        {
            var personRepository = new FakePersonRepository();

            foreach (var person in personRepository.GetAll())
            {
                Console.WriteLine($"FirstName : {person.FirstName} LastName : {person.LastName} " +
                                  $"Is Active : {person.IsActive}");
            }

            PersonDeactivatorService personDeactivation = new PersonDeactivatorService(personRepository,
                                                                                       new EventDispatcher());


            personDeactivation.Execute(1);

            Console.WriteLine("After Raise Event------------------------------------------------");

            foreach (var person in personRepository.GetAll())
            {
                Console.WriteLine($"FirstName : {person.FirstName} LastName : {person.LastName} " +
                                  $"Is Active : {person.IsActive}");
            }
            Console.ReadKey();
        }
        public void Setup()
        {
            _buildingrepository = new FakeBuildingRepository();
            buildingManager     = new BuildingManager(_buildingrepository);

            _personrepository = new FakePersonRepository();
            personManager     = new PersonManager(_personrepository, buildingManager);
        }
 public PersonDeactivatorService(FakePersonRepository repository, IEventDispatcher eventDispatcher)
 {
     _repository      = repository;
     _eventDispatcher = eventDispatcher;
 }
Example #4
0
 public void DDDNullEntityRepository()
 {
     fpr = new FakePersonRepository(null);
 }