Exemplo n.º 1
0
        public async Task GetConfigAsyncThrowsNotImplementedExceptionWhenDataIsEncrypted()
        {
            // Arrange
            var service = new SharedConfigurationService(defaultTableStore, defaultMemoryStore);

            // Assert
            await Assert.ThrowsAsync <NotImplementedException>(async() => await service.GetConfigAsync <string>(DummyServiceName, DummyKeyName, true).ConfigureAwait(false)).ConfigureAwait(false);

            A.CallTo(() => defaultMemoryStore.GetConfig(A <string> .Ignored)).MustNotHaveHappened();
            A.CallTo(() => defaultMemoryStore.SetConfig(A <string> .Ignored, A <object> .Ignored)).MustNotHaveHappened();
            A.CallTo(() => defaultTableStore.GetCloudConfigAsync(A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
        }
Exemplo n.º 2
0
        public SharedConfigurationServiceTests()
        {
            this.defaultMemoryStore = A.Fake <ISharedConfigCacheProvider>();
            A.CallTo(() => defaultMemoryStore.GetConfig(A <string> .Ignored)).Returns(string.Empty);

            this.defaultTableStore = A.Fake <IConfigurationRepository>();
        }