Exemple #1
0
        protected static void WriteFailed <T, TException>(IWriteBuffer <T> buffer, T item)
            where TException : Exception
        {
            Action act = () => buffer.TryWrite(item);

            act.Should().Throw <TException>();
        }
Exemple #2
0
        private static void RunLoop(IWriteBuffer <char> writeBuffer, ILogger logger)
        {
            logger.LogInformation("Press 'esc' to exit");
            logger.LogInformation("Press any key to stream it to the output file:");

            while (true)
            {
                ConsoleKeyInfo keyPress = Console.ReadKey();
                if (keyPress.Key == ConsoleKey.Escape)
                {
                    return;
                }

                writeBuffer.TryWrite(keyPress.KeyChar);
            }
        }
Exemple #3
0
        protected static void Write <T>(IWriteBuffer <T> buffer, T item)
        {
            bool result = buffer.TryWrite(item);

            result.Should().BeTrue();
        }