public async Task SetConfigAsyncThrowsNotImplementedExceptionWhenDataIsEncrypted() { // Arrange var service = new SharedConfigurationService(defaultTableStore, defaultMemoryStore); // Assert await Assert.ThrowsAsync <NotImplementedException>(async() => await service.SetConfigAsync <string>(DummyServiceName, DummyKeyName, "someData", true).ConfigureAwait(false)).ConfigureAwait(false); A.CallTo(() => defaultTableStore.SetCloudConfigAsync(A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened(); A.CallTo(() => defaultMemoryStore.SetConfig(A <string> .Ignored, A <object> .Ignored)).MustNotHaveHappened(); }
public async Task SetConfigAsyncReturnsTableStoreValueParsedAsString() { // Arrange var valueToInsert = JsonConvert.SerializeObject("SomeResultValue"); var tableStore = A.Fake <IConfigurationRepository>(); A.CallTo(() => tableStore.SetCloudConfigAsync(A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).Returns(valueToInsert); var service = new SharedConfigurationService(tableStore, defaultMemoryStore); // Act await service.SetConfigAsync <string>(DummyServiceName, DummyKeyName, valueToInsert).ConfigureAwait(false); // Assert A.CallTo(() => tableStore.SetCloudConfigAsync(A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).MustHaveHappenedOnceExactly(); A.CallTo(() => defaultMemoryStore.SetConfig(A <string> .Ignored, A <object> .Ignored)).MustHaveHappenedOnceExactly(); }