public override void Initialize() { base.Initialize(); if (!TestContext.Properties.Contains("cached")) { throw new ArgumentException("cached"); } bool cached = Boolean.Parse((string)TestContext.Properties["cached"]); if (!TestContext.Properties.Contains("jskrId")) { throw new ArgumentException("jskrId"); } jskrId = long.Parse((string)TestContext.Properties["jskrId"]); cachedModel = cached ? new TransitionJobseekerDetailsModel() : null; cacheService.Setup(c => c.TryGet(It.IsAny <KeyModel>(), out cachedModel)).Returns(cached); //setup wcf call if (!cached) { searchResponse = new TransitionJobseekerDetailsResponse(); responseModel = MappingEngine.Map <TransitionJobseekerDetailsModel>(searchResponse); mappings.Setup(m => m.Map <TransitionJobseekerDetailsResponse, TransitionJobseekerDetailsModel>(searchResponse)).Returns(responseModel); } }
public override void Cleanup() { cachedModel = null; searchResponse = null; responseModel = null; }