コード例 #1
0
        public void Execute_Fail(string description, string json)
        {
            TestStore store   = new TestStore(json);
            var       command = new CheckCommand.CheckCommandHandler(new FileInfo("./fake_file.json"), store);

            TestConsole console = new TestConsole();

            Assert.ThrowsAnyAsync <JwkCheckException>(() => command.InvokeAsync(console));
            Assert.True(true, description);
        }
コード例 #2
0
        public async Task Execute_Success(string description, string json)
        {
            TestStore store   = new TestStore(json);
            var       command = new CheckCommand.CheckCommandHandler(new FileInfo("./fake_file.json"), store);

            TestConsole console = new TestConsole();
            await command.InvokeAsync(console);

            Assert.True(store.WasRead);
            Assert.Null(store.Output);
            Assert.False(store.WasWritten);
            var output = console.Out.ToString() !;

            Assert.NotEqual(0, output.Length);
            Assert.True(true, description);
        }