Ejemplo n.º 1
0
        public async Task TestChannelReceiver()
        {
            var receiver = new Receiver();
            await receiver.StartReader();

            await receiver.Accept(new SNSRequest());

            var result = await receiver.Reader.ReadAsync();

            Assert.AreNotEqual(result, new SNSRequest());
        }
Ejemplo n.º 2
0
        public void Receiver_IsFalingWithUnsuported()
        {
            var mockCommandhandler = new Mock <ICommandHandler>();

            Func <AveilableCommands, ICommandHandler> commandFactory = cmd => { return(mockCommandhandler.Object); };

            var mockLogger = new Mock <ILogger>();

            var receiver = new Receiver(commandFactory, mockLogger.Object);

            var result = receiver.Accept(new string[] { "usup" });

            Assert.False(result);
        }
Ejemplo n.º 3
0
        public void Receiver_IsAccepting(string command)
        {
            var mockCommandhandler = new Mock <ICommandHandler>();

            Func <AveilableCommands, ICommandHandler> commandFactory = cmd => { return(mockCommandhandler.Object); };

            var mockLogger = new Mock <ILogger>();

            var receiver = new Receiver(commandFactory, mockLogger.Object);

            var result = receiver.Accept(new string[] { command });

            Assert.True(result);
        }