public async Task TranslateWithNoKeyThrows() { var store = Substitute.For <ILocaleSpeechStore>(); store.Get(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <object[]>()).Returns((IOutputSpeech)null); var client = new Alexa.NET.LocaleSpeech.LocaleSpeech(store, "locale"); await Assert.ThrowsAsync <ArgumentOutOfRangeException>(() => client.Get("test")); }
public async Task TranslateWithKeyReturnsResult() { var speech = new PlainTextOutputSpeech { Text = "this is a test" }; var store = Substitute.For <ILocaleSpeechStore>(); store.Get(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <object[]>()).Returns(speech); var client = new Alexa.NET.LocaleSpeech.LocaleSpeech(store, "locale"); var result = await client.Get("test"); Assert.Equal(speech, result); }