public void AllowsCreatingContextWithoutSettingAccessor() { // Arrange var contextFactory = new ProtoContextFactory(Options.Create(new FormOptions()), new MyServiceScopeFactory()); // Act & Assert var context = contextFactory.Create(new FeatureCollection()); contextFactory.Dispose(context); }
public void CreateProtoContextSetsProtoContextAccessor() { // Arrange var accessor = new ProtoContextAccessor(); var contextFactory = new ProtoContextFactory(Options.Create(new FormOptions()), new MyServiceScopeFactory(), accessor); // Act var context = contextFactory.Create(new FeatureCollection()); // Assert Assert.Same(context, accessor.ProtoContext); }