public void GetFormatterTest_ThrowsException(string formatterName) { // Arrange var manager = new FormatterManager(); // Act IReportFormatter TestAction() => manager.GetFormatter(formatterName); // Assert Assert.That(TestAction, Throws.TypeOf <FormatterNotFoundException>()); }
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)); }
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); } }