public IntegrationTest() { context = GetDbHelper.GetDbContext(); PolicyRepository = new PolicyRepository(context); CustomerRepository = new CustomerRepository(context); CustomerPolicyRepository = new CustomerPolicyRepository(context); }
public void GetCustomersPolicy() { CpeDbContext context = GetDbHelper.GetDbContext(); CustomerPolicyRepository CustomerPolicyRepository = new CustomerPolicyRepository(context); var list = CustomerPolicyRepository.GetAll(); Assert.IsNotNull(list); }
public static CpeDbContext GetDbContext() { var optionsBuilder = new DbContextOptionsBuilder <CpeDbContext>(); optionsBuilder.UseSqlServer(DbConnectionString); var context = new CpeDbContext(optionsBuilder.Options); return(context); }
public void AddExistingValue() { CpeDbContext context = GetDbHelper.GetDbContext(); CustomerPolicyRepository CustomerPolicyRepository = new CustomerPolicyRepository(context); CustomerPolicyModel customerPolicy = new CustomerPolicyModel() { CustomerId = 1, PolicyId = 1 }; CustomerPolicyRepository.Add(customerPolicy); Assert.Fail(); }
public PolicyRepository(CpeDbContext context) { _context = context; }
public CustomerPolicyRepository(CpeDbContext context) { _context = context; }
public PolicyUnitTest1() { context = GetDbHelper.GetDbContext(); PolicyRepository = new PolicyRepository(context); }