Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #3
0
        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>());
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }