Exemple #1
0
        public static void ClassInitialize(TestContext testContext)
        {
            if (testContext is null)
            {
                throw new System.ArgumentNullException(nameof(testContext));
            }

            SharedProvider = new OpenApiResourceKindProvider(new FakeLogger <OpenApiResourceKindProvider>());
        }
Exemple #2
0
        public async Task ResourceKindAreCachedByAtProviderLevel()
        {
            // arrange
            var provider1 = new OpenApiResourceKindProvider(new FakeLogger <OpenApiResourceKindProvider>());
            var provider2 = new OpenApiResourceKindProvider(new FakeLogger <OpenApiResourceKindProvider>());

            // act
            var pod1a = await provider1.GetResourceKindAsync("v1", "Pod");

            var pod1b = await provider1.GetResourceKindAsync("v1", "Pod");

            var pod2a = await provider2.GetResourceKindAsync("v1", "Pod");

            var pod2b = await provider2.GetResourceKindAsync("v1", "Pod");

            // assert
            pod1a.ShouldBeSameAs(pod1b);
            pod2a.ShouldBeSameAs(pod2b);
            pod1a.ShouldNotBeSameAs(pod2a);
            pod1a.ShouldNotBeSameAs(pod2b);
            pod1b.ShouldNotBeSameAs(pod2a);
            pod1b.ShouldNotBeSameAs(pod2b);
        }