Exemplo n.º 1
0
        public void ThenTheSummaryViewRetrievesCookieData()
        {
            //Arrange
            var employerAccountData = new EmployerAccountData
            {
                OrganisationStatus            = "Active",
                OrganisationName              = "Test Company",
                OrganisationDateOfInception   = DateTime.MaxValue,
                OrganisationReferenceNumber   = "ABC12345",
                OrganisationRegisteredAddress = "My Address",
                PayeReference   = "123/abc",
                EmployerRefName = "Test Scheme 1",
                EmpRefNotFound  = true
            };

            _cookieService.Setup(x => x.Get(It.IsAny <string>()))
            .Returns(employerAccountData);

            var context = new Mock <HttpContextBase>();

            //Act
            var model = _employerAccountOrchestrator.GetSummaryViewModel(context.Object);

            //Assert
            Assert.AreEqual(employerAccountData.OrganisationName, model.Data.OrganisationName);
            Assert.AreEqual(employerAccountData.OrganisationStatus, model.Data.OrganisationStatus);
            Assert.AreEqual(employerAccountData.OrganisationReferenceNumber, model.Data.OrganisationReferenceNumber);
            Assert.AreEqual(employerAccountData.PayeReference, model.Data.PayeReference);
            Assert.AreEqual(employerAccountData.EmployerRefName, model.Data.EmployerRefName);
            Assert.AreEqual(employerAccountData.EmpRefNotFound, model.Data.EmpRefNotFound);
        }
        public ViewResult Summary()
        {
            var result = _employerAccountOrchestrator.GetSummaryViewModel(HttpContext);

            return(View(result));
        }