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" })); } } }
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()); } } }