public void AddNullGrainStorageAsDefaultAddsServices() { // arrange var builder = new FakeOutkeepServerBuilder(); // act var result = builder.AddNullGrainStorageAsDefault(); // assert Assert.Same(builder, result); Assert.IsType <NullGrainStorage>(builder.BuildServiceProvider(null !, null !).GetServiceByName <IGrainStorage>(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME)); }
public void AddNullGrainStorageAddsServices() { // arrange var builder = new FakeOutkeepServerBuilder(); var name = Guid.NewGuid().ToString(); // act var result = builder.AddNullGrainStorage(name); // assert Assert.Same(builder, result); Assert.IsType <NullGrainStorage>(builder.BuildServiceProvider(null !, null !).GetServiceByName <IGrainStorage>(name)); }
public void ConfigureServicesConfiguresServices() { // arrange var builder = new FakeOutkeepServerBuilder(); // act builder.ConfigureServices(services => { services.AddSingleton <IFakeService, FakeService>(); }); // assert Assert.IsType <FakeService>(builder.BuildServiceProvider(null !, null !).GetService <IFakeService>()); }
public void UseAzure() { // arrange var builder = new FakeOutkeepServerBuilder(); var properties = new Dictionary <object, object>(); var context = new HostBuilderContext(properties); var silo = new FakeSiloBuilder(); // act builder.UseAzure(); builder.BuildServiceProvider(context, silo); // assert Assert.True(true); }
public void ConfigureConfiguresServices() { // arrange var builder = new FakeOutkeepServerBuilder(); var value = Guid.NewGuid(); // act builder.Configure <FakeOptions>(options => { options.Value = value; }); // assert Assert.Equal(value, builder.BuildServiceProvider(null !, null !).GetService <IOptions <FakeOptions> >().Value.Value); }