예제 #1
0
        public DeleteDraftApprenticeshipTestsFixture()
        {
            var fixture = new AutoFixture.Fixture();

            CommitmentApiClient = new Mock <ICommitmentsApiClient>();
            CommitmentApiClient.Setup(x => x.GetCohort(It.IsAny <long>(), It.IsAny <CancellationToken>())).ReturnsAsync(new GetCohortResponse());

            var deleteDraftApprenticeshipViewModel = new DeleteDraftApprenticeshipViewModel
            {
                FirstName = "John",
                LastName  = "Jack",
                CohortId  = CohortId,
                DraftApprenticeshipHashedId = DraftApprenticeshipHashedId,
                AccountHashedId             = AccountHashedId,
            };

            ModelMapperMock = new Mock <IModelMapper>();
            ModelMapperMock.Setup(x => x.Map <DeleteDraftApprenticeshipViewModel>(It.IsAny <DeleteApprenticeshipRequest>()))
            .ReturnsAsync(deleteDraftApprenticeshipViewModel);

            AuthorizationServiceMock = new Mock <IAuthorizationService>();

            Sut = new DraftApprenticeshipController(
                ModelMapperMock.Object,
                CommitmentApiClient.Object,
                AuthorizationServiceMock.Object);


            Sut.TempData = new Mock <ITempDataDictionary>().Object;
        }
 public void SetUp()
 {
     HostSpy.Reset();
     _fixture     = new AutoFixture.Fixture();
     _hostBuilder = CreateHostBuilder();
 }