public AccountsControllerTests()
        {
            HttpContext.Current = HttpContextMockFactory.Create();
            var dictionaryPhraseRepository = Substitute.For <IDictionaryPhraseRepository>();

            dictionaryPhraseRepository.Get(Arg.Any <string>(), Arg.Any <string>()).Returns(x => x[1] as string);
            HttpContext.Current.Items["DictionaryPhraseRepository.Current"] = dictionaryPhraseRepository;
        }
示例#2
0
        public object Create(object request, ISpecimenContext context)
        {
            if (typeof(HttpContext).Equals(request))
            {
                return(HttpContextMockFactory.Create());
            }

            return(new NoSpecimen());
        }
示例#3
0
        public void ParametersXml_ParametersXmlIsSet_ReturnParameters([Frozen] ISheerService sheerService)
        {
            //Arrange
            var parametersXml    = @"<outcome>{9016E456-95CB-42E9-AD58-997D6D77AE83}</outcome>";
            var baseActionEditor = new BaseActionEditorMock(sheerService);

            HttpContext.Current = HttpContextMockFactory.Create(new HttpRequest("", "http://google.com", "params=1"));
            HttpContext.Current.Session["1"] = parametersXml;

            //Assert
            var p = baseActionEditor.ParametersMock["outcome"].Should().Be("{9016E456-95CB-42E9-AD58-997D6D77AE83}");
        }
 public DemoControllerTests()
 {
     HttpContext.Current = HttpContextMockFactory.Create();
     HttpContext.Current.Items["DictionaryPhraseRepository.Current"] = Substitute.For <IDictionaryPhraseRepository>();
 }
 public SitecoreExtensionsTests()
 {
     this.dictionaryPhraseRepository = Substitute.For <IDictionaryPhraseRepository>();
     HttpContext.Current             = HttpContextMockFactory.Create();
     HttpContext.Current.Items["DictionaryPhraseRepository.Current"] = this.dictionaryPhraseRepository;
 }
 public InvalidDatasourceItemExceptionProcessorTests()
 {
     HttpContext.Current = HttpContextMockFactory.Create();
     HttpContext.Current.Items["DictionaryPhraseRepository.Current"] = Substitute.For <IDictionaryPhraseRepository>();
 }
 public DemoControllerTests()
 {
     HttpContext.Current = HttpContextMockFactory.Create();
 }
 public UserProfileServiceTests()
 {
     HttpContext.Current = HttpContextMockFactory.Create();
     HttpContext.Current.Items["DictionaryPhraseRepository.Current"] = Substitute.For <IDictionaryPhraseRepository>();
 }