public WhenCallingGetWhatIsTheNewPriceTestsFixture() : base()
        {
            _request   = _autoFixture.Create <ChangeOfProviderRequest>();
            _viewModel = _autoFixture.Create <WhatIsTheNewPriceViewModel>();

            _mockMapper.Setup(m => m.Map <WhatIsTheNewPriceViewModel>(_request))
            .ReturnsAsync(_viewModel);
        }
Пример #2
0
        public WhenCallingGetWhatIsTheNewPriceTestsFixture() : base()
        {
            _request   = _autoFixture.Create <ChangeOfProviderRequest>();
            _viewModel = _autoFixture.Create <WhatIsTheNewPriceViewModel>();

            _mockMapper
            .Setup(m => m.Map <WhatIsTheNewPriceViewModel>(_request))
            .ReturnsAsync(_viewModel);

            _mockUrlHelper
            .Setup(mock => mock.Link(RouteNames.ConfirmDetailsAndSendRequest, It.IsAny <object>()))
            .Returns(ConfirmDetailsLink)
            .Callback(() => ExpectedBackLinkSet = ConfirmDetailsLink);

            _mockUrlHelper
            .Setup(mock => mock.Link(RouteNames.WhatIsTheNewEndDate, It.IsAny <object>()))
            .Returns(PreviousQuestionLink)
            .Callback(() => ExpectedBackLinkSet = PreviousQuestionLink);
        }
Пример #3
0
 public async Task <IActionResult> WhatIsTheNewPrice(WhatIsTheNewPriceViewModel viewModel)
 {
     return(await _controller.WhatIsTheNewPrice(viewModel));
 }
Пример #4
0
 public void Arrange()
 {
     _autoFixture = new Fixture();
     _fixture     = new WhenPostingWhatIsTheNewPriceTestsFixture();
     _viewModel   = _autoFixture.Build <WhatIsTheNewPriceViewModel>().Create();
 }
        public async Task NewPrice_IsMapped(WhatIsTheNewPriceViewModel viewModel)
        {
            var result = await _mapper.Map(viewModel);

            Assert.AreEqual(viewModel.NewPrice, result.NewPrice);
        }
        public async Task EmployerWillAdd_IsMapped(WhatIsTheNewPriceViewModel viewModel)
        {
            var result = await _mapper.Map(viewModel);

            Assert.AreEqual(viewModel.EmployerWillAdd, result.EmployerWillAdd);
        }
        public async Task ProviderName_IsMapped(WhatIsTheNewPriceViewModel viewModel)
        {
            var result = await _mapper.Map(viewModel);

            Assert.AreEqual(viewModel.ProviderName, result.ProviderName);
        }
        public async Task AccountHashedId_IsMapped(WhatIsTheNewPriceViewModel viewModel)
        {
            var result = await _mapper.Map(viewModel);

            Assert.AreEqual(viewModel.AccountHashedId, result.AccountHashedId);
        }
Пример #9
0
        public async Task <IActionResult> WhatIsTheNewPrice(WhatIsTheNewPriceViewModel viewModel)
        {
            var request = await _modelMapper.Map <ChangeOfProviderRequest>(viewModel);

            return(RedirectToRoute(RouteNames.ConfirmDetailsAndSendRequest, request));
        }