/// <summary> /// Initializes a new instance of the <see cref="ContractAlertController"/> class. /// </summary> public ContractAlertController() { int facilityId = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]); string bubbleDataSource = GetFacilityConnection(facilityId); _contarctAlertsLogic = new ContractAlertLogic(bubbleDataSource); }
public void ContarctAlertsLogicConstructorTest1() { Mock <IContractAlertRepository> mockProductRepository = new Mock <IContractAlertRepository>(); ContractAlertLogic target = new ContractAlertLogic(mockProductRepository.Object); Assert.IsInstanceOfType(target, typeof(ContractAlertLogic)); }
public void GetContractAlertsNullTest() { var repository = new Mock <IContractAlertRepository>(); repository.Setup(f => f.GetContractAlerts(null)); ContractAlertLogic target = new ContractAlertLogic(repository.Object); List <ContractAlert> actual = target.GetContractAlerts(null); Assert.AreEqual(null, actual); }
public void UpdateContractAlertsIfNullTest() { var repository = new Mock <IContractAlertRepository>(); repository.Setup(f => f.UpdateContractAlerts(null)); ContractAlertLogic target = new ContractAlertLogic(repository.Object); bool actual = target.UpdateContractAlerts(null); Assert.AreEqual(false, actual); }
public void UpdateContractAlertsMockTest1() { Mock <IContractAlertRepository> mockContractAlertsRepository = new Mock <IContractAlertRepository>(); ContractAlert objContractAlert = new ContractAlert { ContractId = 1 }; mockContractAlertsRepository.Setup(f => f.UpdateContractAlerts(objContractAlert)).Returns(true); ContractAlertLogic target = new ContractAlertLogic(mockContractAlertsRepository.Object); bool actual = target.UpdateContractAlerts(objContractAlert); Assert.AreEqual(true, actual); }
public void GetContractAlertsMockTest() { //Mock input ContractAlert contractAlertList = new ContractAlert { UserName = "******" }; //Mock output List <ContractAlert> test = new List <ContractAlert> { new ContractAlert { PayerName = "BCBS AL", ContractName = "Maha testing #2013-13", ContractId = 1526, DateOfExpiry = new DateTime(11 / 7 / 2013), }, new ContractAlert { PayerName = "AETNA", ContractName = "Ragini Test123 #2013-13", ContractId = 1533, DateOfExpiry = new DateTime(10 / 9 / 2013), }, new ContractAlert { PayerName = "BCBS AL", ContractName = "Copy Of Maha testing #2013-13", ContractId = 1540, DateOfExpiry = new DateTime(11 / 7 / 2013), }, new ContractAlert { PayerName = "AETNA", ContractName = "Copy Of Ragini Test123 #2013-13", ContractId = 1544, DateOfExpiry = new DateTime(10 / 9 / 2013), }, }; List <ContractAlert> expected = test; //Mock setup Mock <IContractAlertRepository> mockProductRepository = new Mock <IContractAlertRepository>(); mockProductRepository.Setup(f => f.GetContractAlerts(It.IsAny <ContractAlert>())).Returns(test); ContractAlertLogic target = new ContractAlertLogic(mockProductRepository.Object); List <ContractAlert> actual = target.GetContractAlerts(contractAlertList); Assert.AreEqual(expected, actual); }
public void UpdateContractAlertsIfNotNullTest() { //Arrange var repository = new Mock <IContractAlertRepository>(); ContractAlert value = new ContractAlert(); repository.Setup(f => f.UpdateContractAlerts(It.IsAny <ContractAlert>())).Returns(true); ContractAlertLogic target = new ContractAlertLogic(repository.Object); //Act bool actual = target.UpdateContractAlerts(value); //Assert Assert.AreEqual(true, actual); }
public void ContarctAlertsLogicConstructorTest() { ContractAlertLogic target = new ContractAlertLogic(Constants.ConnectionString); Assert.IsInstanceOfType(target, typeof(ContractAlertLogic)); }