public void Throw_ArgumentNullException_WithProperMessage_When_ItemName_IsNull() { // Arange var service = new HttpCacheService(); // Act & Assert Assert.That( () => service.Remove(null), Throws.ArgumentNullException.With.Message.Contains( GlobalConstants.ItemNameRequiredExceptionMessage)); }
public void Throw_ArgumentNullException_WithProperMessage_When_ItemName_IsNull() { // Arange var mockedFunc = new Mock <Func <DummyGuidClass> >(); var durationInSeconds = (uint)1; var service = new HttpCacheService(); // Act & Assert Assert.That( () => service.Get(null, mockedFunc.Object, durationInSeconds), Throws.ArgumentNullException.With.Message.Contains( GlobalConstants.ItemNameRequiredExceptionMessage)); }
public void CreateInstance_WhenAllParametersArePassedCorrectly() { // Arrange ISalaryCalculatorDbContext dbContext = new SalaryCalculatorDbContext(); IRepository <User> userRepo = new SalaryCalculatorRepository <User>(dbContext); IRepository <EmployeePaycheck> paycheckRepo = new SalaryCalculatorRepository <EmployeePaycheck>(dbContext); IRepository <RemunerationBill> billRepo = new SalaryCalculatorRepository <RemunerationBill>(dbContext); IRepository <SelfEmployment> selfRepo = new SalaryCalculatorRepository <SelfEmployment>(dbContext); ICacheService cacheService = new HttpCacheService(); IUserService userService = new UserService(userRepo); IEmployeePaycheckService paycheckService = new EmployeePaycheckService(paycheckRepo); IRemunerationBillService billService = new RemunerationBillService(billRepo); ISelfEmploymentService selfEmploymentService = new SelfEmploymentService(selfRepo); // Act & Assert Assert.IsInstanceOf <HomeController>(new HomeController(cacheService, userService, paycheckService, billService, selfEmploymentService)); }
public void CreateInstanceOfIChacheService() { var rim = new HttpCacheService(); Assert.That(rim, Is.InstanceOf <ICacheService>()); }
public void CacheServiceConstructor_ExpectedException() { var target = new HttpCacheService(null); Assert.Fail("Expected Exception"); }