public void CanCreateDtoWithEntity() { Region region = new Region("Eastern"); region.SetAssignedIdTo(1); RegionDto regionDto = RegionDto.Create(region); regionDto.Id.ShouldEqual(1); regionDto.Description.ShouldEqual("Eastern"); }
protected override void LoadTestData() { Region region = new Region("Northern"); region.SetAssignedIdTo(1); regionRepository.Save(region); FlushSessionAndEvict(region); Territory territory = new Territory("Troy", region); territory.SetAssignedIdTo("48084"); territoryRepository.Save(territory); FlushSessionAndEvict(territory); Employee employee = new Employee("Joe", "Smith"); employee.Territories.Add(territory); employeeRepository.SaveOrUpdate(employee); FlushSessionAndEvict(employee); }