Beispiel #1
0
        public void PartitionName()
        {
            var factory = new TenantSpecificMemoizerFactory(NullLoggerFactory.Instance, _requestScope);
            var p       = factory.GetOrCreatePartition("Part1");

            p.DisplayName.Is("Tenant1>Part1");

            var factory2 = new TenantSpecificMemoizerFactory(NullLoggerFactory.Instance, RequestScope.Static("Tenant2"));
            var p2       = factory2.GetOrCreatePartition("Part2");

            p2.DisplayName.Is("Tenant2>Part2");
        }
Beispiel #2
0
        public void Partitions()
        {
            var factory = new TenantSpecificMemoizerFactory(NullLoggerFactory.Instance, RequestScope.Static("Tenant3"));

            factory.Partitions.Should().BeEmpty();

            var tenantPartition = factory.GetOrCreatePartition("TenantPartition");

            factory.Partitions.Should()
            .ContainSingle()
            .And
            .Contain(tenantPartition);
            GlobalFactory.Partitions.Should().NotContain(tenantPartition);
        }
Beispiel #3
0
 public ScopedMemoizerFactoryExampleTests()
 {
     GlobalFactory = MemoizerFactory.Global;
     _requestScope = RequestScope.Static("Tenant1");
 }