public StreamJournalWriter(IStore storage, EngineConfiguration config) { _config = config; _storage = storage; _journalFormatter = config.CreateFormatter(FormatterUsage.Journal); _rolloverStrategy = _config.CreateRolloverStrategy(); }
public void InjectedFormatterIsResolved() { var config = new EngineConfiguration(); config.PacketOptions = null; var expected = new BinaryFormatter(); config.SetFormatterFactory((c,f) => expected); var actual = config.CreateFormatter(FormatterUsage.Default); Assert.AreSame(expected, actual); }
public void PacketingFormatterIsReturnedWhenPaketOptionsArePresent() { var config = new EngineConfiguration(); config.PacketOptions = PacketOptions.Checksum; config.SetFormatterFactory((c, f) => new BinaryFormatter()); var actual = config.CreateFormatter(FormatterUsage.Journal); Assert.IsInstanceOf <PacketingFormatter>(actual); }
public void InjectedFormatterIsResolved() { var config = new EngineConfiguration(); config.PacketOptions = null; var expected = new BinaryFormatter(); config.SetFormatterFactory((c, f) => expected); var actual = config.CreateFormatter(FormatterUsage.Default); Assert.AreSame(expected, actual); }
public void Setup() { var substitutions = new Dictionary <string, Type>(); substitutions[typeof(TypeA).FullName] = typeof(TypeB); substitutions[typeof(GenericDummy <TypeA, TypeA>).FullName] = typeof(GenericDummy <TypeB, TypeB>); substitutions[typeof(NestedA).FullName] = typeof(NestedB); var config = new EngineConfiguration(); config.SetSerializationTypeMappings(substitutions); _formatter = config.CreateFormatter(FormatterUsage.Default); }
protected SnapshotStore(EngineConfiguration config) { _config = config; _formatter = config.CreateFormatter(FormatterUsage.Snapshot); }
public RoyalFoodTaster(EngineConfiguration config, Model model) : base(config, model) { _formatter = config.CreateFormatter(FormatterUsage.Snapshot); _foodTaster = _formatter.Clone(Model); }
public void PacketingFormatterIsReturnedWhenPaketOptionsArePresent() { var config = new EngineConfiguration(); config.PacketOptions = PacketOptions.Checksum; config.SetFormatterFactory((c,f) => new BinaryFormatter()); var actual = config.CreateFormatter(FormatterUsage.Journal); Assert.IsInstanceOfType(actual, typeof(PacketingFormatter)); }
public override void Initialize() { _formatter = _config.CreateFormatter(FormatterUsage.Journal); base.Initialize(); }
protected SnapshotStore(EngineConfiguration config) { _config = config; _formatter = config.CreateFormatter(FormatterUsage.Snapshot); }
public StreamJournalWriter(EngineConfiguration config, Func<ulong,Stream> streamFactory) { _streamProvider = streamFactory; _journalFormatter = config.CreateFormatter(FormatterUsage.Journal); _rolloverStrategy = config.CreateRolloverStrategy(); }