public override void Cleanup()
 {
     searchRequest  = null;
     searchModel    = null;
     cachedModel    = null;
     searchResponse = null;
     responseModel  = null;
 }
 public override void Initialize()
 {
     base.Initialize();
     jskrId      = 123;
     searchModel = new ProviderInformationSearchModel()
     {
         SiteCode = ""
     };
 }
            public override void Initialize()
            {
                base.Initialize();

                if (!TestContext.Properties.Contains("cached"))
                {
                    throw new ArgumentException("cached");
                }
                bool cached = Boolean.Parse((string)TestContext.Properties["cached"]);

                string siteCode = TestContext.Properties.Contains("siteCode")
                                      ? (string)TestContext.Properties["siteCode"]
                                      : String.Empty;

                searchModel = new ProviderInformationSearchModel()
                {
                    SiteCode = siteCode
                };
                searchRequest = MappingEngine.Map <ProviderInformationRequest>(searchModel);
                mappings.Setup(m => m.Map <ProviderInformationRequest>(searchModel)).Returns(searchRequest);
                mappings.Setup(m => m.Map <ProviderInformationModel>(It.IsAny <ProviderInformationModel>())).Returns <ProviderInformationModel>(m => m);

                cachedModel = cached ? new ProviderInformationModel()
                {
                    NominalJobseekerList = new List <NominalJobseekerListItem>()
                } : null;
                var list = new List <ProviderInformationModel> {
                    cachedModel
                };

                cacheService.Setup(c => c.TryGet(It.IsAny <KeyModel>(), out list)).Returns(cached);

                //setup wcf call
                if (!cached)
                {
                    searchResponse = new ProviderInformationResponse()
                    {
                        NominalJobseekers = new List <NominalJobseekerItem>().ToArray()
                    };
                    responseModel = MappingEngine.Map <ProviderInformationModel>(searchResponse);
                    mappings.Setup(m => m.Map <ProviderInformationResponse, ProviderInformationModel>(searchResponse)).Returns(responseModel);
                }
            }
 public override void Cleanup()
 {
     searchModel = null;
 }