public IndexTests()
            {
                _projectId = Guid.NewGuid();
                var academyId = Guid.NewGuid();

                _foundProject = new GetProjectsResponseModel
                {
                    ProjectId        = _projectId,
                    ProjectAcademies = new List <GetProjectsAcademyResponseModel>
                    {
                        new GetProjectsAcademyResponseModel {
                            AcademyId = academyId
                        }
                    }
                };

                _foundDynamicsAcademy = new GetAcademiesModel
                {
                    Ukprn                = "FoundUKPRN",
                    EstablishmentType    = "Cat school",
                    OfstedInspectionDate = DateTime.Parse("2021-01-01")
                };

                _foundAcademy = new Academy
                {
                    Ukprn       = "ukprn",
                    Performance = new AcademyPerformance()
                };


                _projectRepository.Setup(r => r.GetProjectById(_projectId)).ReturnsAsync(
                    new RepositoryResult <GetProjectsResponseModel> {
                    Result = _foundProject
                });

                _dynamicsAcademiesRepository.Setup(r => r.GetAcademyById(academyId)).ReturnsAsync(
                    new RepositoryResult <GetAcademiesModel> {
                    Result = _foundDynamicsAcademy
                });

                _academiesRepository.Setup(r => r.GetAcademyByUkprn("FoundUKPRN"))
                .ReturnsAsync(new RepositoryResult <Academy> {
                    Result = _foundAcademy
                });
            }
Пример #2
0
            public IndexTests()
            {
                _projectId = Guid.NewGuid();
                var academyId = Guid.NewGuid();

                _foundProject = new GetProjectsResponseModel
                {
                    ProjectId        = _projectId,
                    ProjectAcademies = new List <GetProjectsAcademyResponseModel>
                    {
                        new GetProjectsAcademyResponseModel {
                            AcademyId = academyId
                        }
                    }
                };

                var foundDynamicsAcademy = new GetAcademiesModel
                {
                    Ukprn = "FoundUKPRN",
                };

                _foundAcademy = new Academy
                {
                    Ukprn       = "ukprn",
                    Performance = new AcademyPerformance()
                };


                _projectRepository.Setup(r => r.GetProjectById(_projectId)).ReturnsAsync(
                    new RepositoryResult <GetProjectsResponseModel> {
                    Result = _foundProject
                });

                _dynamicsAcademiesRepository.Setup(r => r.GetAcademyById(academyId)).ReturnsAsync(
                    new RepositoryResult <GetAcademiesModel> {
                    Result = foundDynamicsAcademy
                });

                _academiesRepository.Setup(r => r.GetAcademyByUkprn("FoundUKPRN"))
                .ReturnsAsync(new RepositoryResult <Academy> {
                    Result = _foundAcademy
                });
            }