コード例 #1
0
        public void CosmosContainerNameProviderGetsNameFromType()
        {
            ICosmosContainerNameProvider provider = new DefaultCosmosContainerNameProvider();

            string name = provider.GetContainerName <SomethingItem>();

            Assert.Equal("SomethingItem", name);
        }
コード例 #2
0
        public void CosmosContainerNameProviderGetsNameFromAttribute()
        {
            ICosmosContainerNameProvider provider = new DefaultCosmosContainerNameProvider();

            string name = provider.GetContainerName <CustomContainerNameItem>();

            Assert.Equal("SomethingCustom", name);
        }
        public void CosmosContainerNameProviderGetsNameForTypeWhenEmptyStringProvidedByOptions()
        {
            _repositoryOptions.ContainerBuilder.Configure <SomeOtherItem>(options => options.WithContainer(""));

            ICosmosContainerNameProvider provider = new DefaultCosmosContainerNameProvider(_options.Object);

            string name = provider.GetContainerName <SomeOtherItem>();

            Assert.Equal("SomeOtherItem", name);
        }
        public void CosmosContainerNameProviderGetsNameForTypeWhenProvidedByOptions()
        {
            _repositoryOptions.ContainerBuilder.Configure <CustomTypeOverridenByOptions>(options => options.WithContainer("SomethingDefinedByOptions"));

            ICosmosContainerNameProvider provider = new DefaultCosmosContainerNameProvider(_options.Object);

            string name = provider.GetContainerName <CustomTypeOverridenByOptions>();

            Assert.Equal("SomethingDefinedByOptions", name);
        }