Пример #1
0
 public void Inject(IStoryContext context)
 {
     systemSound   = context.SystemSound;
     audioPlayer   = context.AudioPlayer;
     storyPlayer   = context.StoryPlayer;
     messageLogger = context.MessageLogger;
 }
        public static async Task ThrowsTrueException(this IStoryPlayer storyPlayer, IStory story, string messagePattern = null)
        {
            async Task TestCode()
            {
                await storyPlayer.Play(story);
            }

            // ReSharper disable once PossibleNullReferenceException
            var exception = await Record.ExceptionAsync(TestCode);

            Assert.NotNull(exception);
            Assert.IsType <TrueException>(exception);

            if (!string.IsNullOrEmpty(messagePattern))
            {
                Assert.Matches(messagePattern, exception.Message);
            }
        }
 public void Inject(IStoryContext context)
 {
     this.assetSource  = context.AssetSource;
     this.msgPresenter = context.MessagePresenter;
     this.storyPlayer  = context.StoryPlayer;
 }