Exemplo n.º 1
0
 public void AddDuplicateNameThrowsBussinesException()
 {
     using (var dbContext = GetContext())
     {
         using (var facilityManagement = new FacilityManagement(dbContext,
                                                                TestHelper.GetGenericPrincipalAdmin(), mapper))
         {
             facilityManagement.Create(new Facility {
                 Name = "Test"
             });
             Assert.Throws <BussinesException>(() => facilityManagement.Create(new Facility {
                 Name = "Test"
             }));
         }
     }
 }
Exemplo n.º 2
0
 public void CanAddFacility()
 {
     using (var ctx = GetContext())
     {
         using (var facilityManagement =
                    new FacilityManagement(ctx, TestHelper.GetGenericPrincipalAdmin(), mapper))
         {
             var facility = new Facility {
                 Name = "Test"
             };
             facilityManagement.Create(facility);
             Assert.True(ctx.GetEntitySet <Facility>().Any());
         }
     }
 }