public IncludeCombiner(IIncludeHandlingSettings settings, IIncludeReader reader, IIncludeStorage storage, IHttpContextProvider http)
 {
     _settings = settings;
     _reader = reader;
     _storage = storage;
     _http = http;
 }
Example #2
0
        public CPreprocessorContext(IIncludeReader IncludeReader, TextWriter TextWriter)
        {
            this.IncludeReader = IncludeReader;
            this.TextWriter = TextWriter;

            this.Macros.Add("__STDC__", new MacroConstant());
            this.Macros.Add("__STDC_VERSION__", new MacroConstant() { Replacement = "199901L" });
            this.Macros.Add("__i386__", new MacroConstant());
            this.Macros.Add("__i386", new MacroConstant());
            this.Macros.Add("i386", new MacroConstant());
            this.Macros.Add("_WIN32", new MacroConstant());
            this.Macros.Add("__ILCC__", new MacroConstant());

            #if false
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant() { Replacement = "unsigned long long" });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant() { Replacement = "long long" });
            #elif false
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant() { Replacement = "unsigned long" });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant() { Replacement = "long" });
            #else
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant() { Replacement = "unsigned int" });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant() { Replacement = "int" });
            #endif
            this.Macros.Add("__WCHAR_TYPE__", new MacroConstant() { Replacement = "unsigned short" });
            //this.Macros.Add("__ASSEMBLER__", new MacroConstant());
            //this.Macros.Add("__BOUNDS_CHECKING_ON", new MacroConstant());
            this.Macros.Add("__CHAR_UNSIGNED__", new MacroConstant());
        }
Example #3
0
 public IncludeCombiner(IIncludeHandlingSettings settings, IIncludeReader reader, IIncludeStorage storage, IHttpContextProvider http)
 {
     _settings = settings;
     _reader   = reader;
     _storage  = storage;
     _http     = http;
 }
 public IncludeCombinerInteractionFacts()
 {
     _mocks = new MockRepository();
     _mockSettings = _mocks.StrictMock<IIncludeHandlingSettings>();
     _mockReader = _mocks.StrictMock<IIncludeReader>();
     _mockStorage = _mocks.StrictMock<IIncludeStorage>();
     _mockHttp = _mocks.StrictMock<IHttpContextProvider>();
     _combiner = new IncludeCombiner(_mockSettings, _mockReader, _mockStorage, _mockHttp);
     _mocks.ReplayAll();
 }
Example #5
0
 public void TestSetup()
 {
     _mocks        = new MockRepository();
     _mockSettings = _mocks.DynamicMock <IIncludeHandlingSettings>();
     _mockReader   = _mocks.DynamicMock <IIncludeReader>();
     _mockStorage  = _mocks.DynamicMock <IIncludeStorage>();
     _mockHttp     = _mocks.DynamicMock <IHttpContextProvider>();
     _combiner     = new IncludeCombiner(_mockSettings, _mockReader, _mockStorage, _mockHttp);
     _mocks.ReplayAll();
 }
Example #6
0
 public CPreprocessor(IIncludeReader IncludeReader = null, TextWriter TextWriter = null)
 {
     if (IncludeReader == null)
     {
         IncludeReader = new IncludeReader();
         //((IncludeReader)IncludeReader).AddFolder(@"c:\dev\tcc\include");
     }
     if (TextWriter == null) TextWriter = new StringWriter();
     this.Context = new CPreprocessorContext(IncludeReader, TextWriter);
 }
        public CPreprocessorContext(IIncludeReader IncludeReader, TextWriter TextWriter)
        {
            this.IncludeReader = IncludeReader;
            this.TextWriter    = TextWriter;

            this.Macros.Add("__STDC__", new MacroConstant());
            this.Macros.Add("__STDC_VERSION__", new MacroConstant()
            {
                Replacement = "199901L"
            });
            this.Macros.Add("__i386__", new MacroConstant());
            this.Macros.Add("__i386", new MacroConstant());
            this.Macros.Add("i386", new MacroConstant());
            this.Macros.Add("_WIN32", new MacroConstant());
            this.Macros.Add("__ILCC__", new MacroConstant());

#if false
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant()
            {
                Replacement = "unsigned long long"
            });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant()
            {
                Replacement = "long long"
            });
#elif false
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant()
            {
                Replacement = "unsigned long"
            });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant()
            {
                Replacement = "long"
            });
#else
            this.Macros.Add("__SIZE_TYPE__", new MacroConstant()
            {
                Replacement = "unsigned int"
            });
            this.Macros.Add("__PTRDIFF_TYPE__", new MacroConstant()
            {
                Replacement = "int"
            });
#endif
            this.Macros.Add("__WCHAR_TYPE__", new MacroConstant()
            {
                Replacement = "unsigned short"
            });
            //this.Macros.Add("__ASSEMBLER__", new MacroConstant());
            //this.Macros.Add("__BOUNDS_CHECKING_ON", new MacroConstant());
            this.Macros.Add("__CHAR_UNSIGNED__", new MacroConstant());
        }
Example #8
0
 public CPreprocessor(IIncludeReader IncludeReader = null, TextWriter TextWriter = null)
 {
     if (IncludeReader == null)
     {
         IncludeReader = new IncludeReader();
         //((IncludeReader)IncludeReader).AddFolder(@"c:\dev\tcc\include");
     }
     if (TextWriter == null)
     {
         TextWriter = new StringWriter();
     }
     this.Context = new CPreprocessorContext(IncludeReader, TextWriter);
 }
        public void ConstructingTradingDetailsController_WithNullIncludeReader_ThrowsArgumentNullException()
        {
            // Arrange
            IIncludeReader includeReader = null;

            // Act
            void Constructing() => new InsolvencyOrderTradingDetailsController(
                mockDataAccessCradle.Object,
                mockTradingDetailsRepository.Object,
                includeReader,
                mockPageInformationProvider.Object,
                mockHalFormatter.Object,
                mockHalCollectionFormatter.Object,
                mockTelemetryClient.Object);

            // Assert
            Assert.ThrowsException <ArgumentNullException>((Action)Constructing);
        }
        public void ConstructingTradingDetailsController_WithNullIncludeReader_HasCorrectParameterNameForArgumentException()
        {
            // Arrange
            const string expectedParameterName = "includeReader";

            IIncludeReader includeReader = null;

            // Act
            void Constructing() => new InsolvencyOrderTradingDetailsController(
                mockDataAccessCradle.Object,
                mockTradingDetailsRepository.Object,
                includeReader,
                mockPageInformationProvider.Object,
                mockHalFormatter.Object,
                mockHalCollectionFormatter.Object,
                mockTelemetryClient.Object);

            // Assert
            ExceptionAssert.HasCorrectParameterNameForArgumentException(Constructing, expectedParameterName);
        }
Example #11
0
 public void TestSetup()
 {
     _mocks = new MockRepository();
     _mockSettings = _mocks.DynamicMock<IIncludeHandlingSettings>();
     _mockReader = _mocks.DynamicMock<IIncludeReader>();
     _mockStorage = _mocks.DynamicMock<IIncludeStorage>();
     _mockHttp = _mocks.DynamicMock<IHttpContextProvider>();
     _combiner = new IncludeCombiner(_mockSettings, _mockReader, _mockStorage, _mockHttp);
     _mocks.ReplayAll();
 }
 public FileSystemIncludeReaderFacts()
 {
     _reader = new FileSystemIncludeReader("/", "c:\\");
 }
 public FileSystemIncludeReaderFacts()
 {
     _reader = new FileSystemIncludeReader("/", Environment.CurrentDirectory);
 }
		public void TestSetup()
		{
			_reader = new FileSystemIncludeReader("/", "c:\\");
		}
 public void TestSetup()
 {
     _reader = new FileSystemIncludeReader("/", Environment.CurrentDirectory);
 }
 public void TestSetup()
 {
     _reader = new FileSystemIncludeReader("/", "c:\\");
 }
		public void TestSetup()
		{
			_reader = new FileSystemIncludeReader("/", Environment.CurrentDirectory);
		}