Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VarianceReportController"/> class.
        /// </summary>
        public VarianceReportController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _varianceReportLogic = new VarianceReportLogic(bubbleDataSource);
        }
        public void GetAllVarianceReportTest()
        {
            VarianceReportLogic target = new VarianceReportLogic(Constants.ConnectionString);
            var actual = target.GetVarianceReport(null);

            Assert.AreEqual(typeof(VarianceReport), actual.GetType());
        }
        public void VarianceReportLogicConstructorTest()
        {
            Mock <IVarianceReportRepository> mockVarianceReportLogic = new Mock <IVarianceReportRepository>();
            VarianceReportLogic target = new VarianceReportLogic(mockVarianceReportLogic.Object);

            Assert.IsInstanceOfType(target, typeof(VarianceReportLogic));
        }
        public void VarianceReportLogiConstructorTest1()
        {
            var target = new VarianceReportLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(VarianceReportLogic));
        }
        public void GetAllVarianceReportTestWithOutRequestAdjudicationName()
        {
            VarianceReport varianceReport = new VarianceReport
            {
                StartDate = DateTime.MinValue,
                EndDate   = DateTime.MinValue
            };

            Mock <IVarianceReportRepository> varianceReportRepository = new Mock <IVarianceReportRepository>();

            varianceReportRepository.Setup(x => x.GetAllVarianceReport(varianceReport)).Returns(varianceReport);

            VarianceReport actualReport = new VarianceReportLogic(varianceReportRepository.Object).GetVarianceReport(varianceReport);

            Assert.AreEqual(varianceReport, actualReport);
            varianceReportRepository.VerifyAll();
        }
        public void GetAllVarianceReportTestWithSpecifiedDate()
        {
            VarianceReport varianceReport = new VarianceReport
            {
                StartDate = DateTime.Now.AddYears(-1),
                EndDate   = DateTime.Now
            };

            Mock <IVarianceReportRepository> varianceReportRepository = new Mock <IVarianceReportRepository>();

            varianceReportRepository.Setup(x => x.GetAllVarianceReport(varianceReport)).Returns(varianceReport);

            VarianceReport actualReport = new VarianceReportLogic(varianceReportRepository.Object).GetVarianceReport(varianceReport);

            Assert.AreEqual(varianceReport, actualReport);
            varianceReportRepository.VerifyAll();
        }