コード例 #1
0
        public static PagedOdataResult <SfApprenticeshipVacancy> GetDummyOdataResultAppVacancies()
        {
            var mappingData = new PagedOdataResult <SfApprenticeshipVacancy>()
            {
                Value = GetDummySfApprenticeshipVacancies(1)
            };

            return(mappingData);
        }
        public void GetJsonToSocMappingMappedData()
        {
            mappingData = DataHelper.GetDummyOdataResultSocMapping();
            var odataclient = A.Fake <IOdataContext <SitefinitySocMapping> >();

            var requestUri = new Uri("http://TestUri.gov.uk");

            A.CallTo(() => odataclient.GetHttpClientAsync()).Returns(new HttpClient());
            A.CallTo(() => odataclient.GetResult(requestUri, A <bool> ._)).Returns(DataHelper.GetDummyOdataResultSocMapping());
        }
        public async Task Get_all_socmappingdata_returned_by_the_repoisotryAsync()
        {
            //Arrange -- Initialize object to be constructed or interface to be injected
            mappingData = DataHelper.GetDummyOdataResultSocMapping();
            var odataRepository = A.Fake <ISocSitefinityOdataRepository>();

            //Act -- Actually should have happended with the Arranged and Act-On object
            A.CallTo(() => odataRepository.GetAllAsync(A <bool> ._)).Returns(mappingData.Value);

            //Assert - should have returned the value as expected and created in the dummy data
            Assert.Equal(mappingData.Value, await odataRepository.GetAllAsync());
        }
        public static PagedOdataResult <SitefinitySocMapping> GetDummyOdataResultSocMapping()
        {
            PagedOdataResult <SitefinitySocMapping> mappingData = new PagedOdataResult <SitefinitySocMapping>()
            {
                MetaData =
                    "http://local-beta.nationalcareersservice.org.uk/api/das-integration/$metadata#jobprofilesocs(NavigateToApprenticeshipStandard(UrlName),NavigateToApprenticeshipFramework(UrlName))",
                NextLink =
                    "http://local-beta.nationalcareersservice.org.uk/api/das-integration/jobprofilesocs?$expand=NavigateToApprenticeshipStandard(%24select%3DUrlName)%2CNavigateToApprenticeshipFramework(%24select%3DUrlName)&$skip=50",
                Value = new List <SitefinitySocMapping>()
                {
                    new SitefinitySocMapping()
                    {
                        SocCode    = "1234",
                        Frameworks = new List <NavigateToApprenticeshipFramework>()
                        {
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "1234"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "2222"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "3333"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "4444"
                            },
                        },
                        Standards = new List <NavigateToApprenticeshipStandard>()
                        {
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "22334"
                            },
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "3333"
                            },
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "4444"
                            }
                        }
                    },

                    new SitefinitySocMapping()
                    {
                        SocCode    = "3333",
                        Frameworks = new List <NavigateToApprenticeshipFramework>()
                        {
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "1234"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "2222"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "3333"
                            },
                            new NavigateToApprenticeshipFramework()
                            {
                                UrlName = "4444"
                            },
                        },
                        Standards = new List <NavigateToApprenticeshipStandard>()
                        {
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "22334"
                            },
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "3333"
                            },
                            new NavigateToApprenticeshipStandard()
                            {
                                UrlName = "4444"
                            }
                        }
                    }
                }
            };

            return(mappingData);
        }