Exemplo n.º 1
0
        public void GetFormatterTest_ThrowsException(string formatterName)
        {
            // Arrange
            var manager = new FormatterManager();

            // Act
            IReportFormatter TestAction() => manager.GetFormatter(formatterName);

            // Assert
            Assert.That(TestAction, Throws.TypeOf <FormatterNotFoundException>());
        }
Exemplo n.º 2
0
        public void GetFormatterTest(IDictionary <string, IReportFormatter> formatterStorage, string formatterName, IReportFormatter expected)
        {
            // Arrange
            var manager = new FormatterManager(formatterStorage);

            // Act
            IReportFormatter formatter = manager.GetFormatter(formatterName);

            // Assert
            Assert.That(formatter, Is.EqualTo(expected));
        }
Exemplo n.º 3
0
        public AowSerializer(bool hasRootWrapper, bool forceClassID)
        {
            _isAbstract     = typeof(T).IsAbstract || forceClassID;
            _hasRootWrapper = hasRootWrapper;

            _formatter = FormatterManager.GetFormatter <T>(isPolymorph: _isAbstract);

            if (_hasRootWrapper)
            {
                _formatter = new WrappingFormatterProxy(_formatter);
            }
        }