Example #1
0
        public void OnCommand_ReturnsNull_WhenCommandSaslMechanism()
        {
            var profile = new AzureSaslProfileProxy();

            DescribedList result = profile.CallOnCommand(new SaslMechanisms());

            result.ShouldBeNull();
        }
Example #2
0
        public void OnCommand_ReturnsAmqpException_WhenCommandNotSupported()
        {
            var command = new SaslChallenge();
            var profile = new AzureSaslProfileProxy();

            AmqpException exception = Should.Throw <AmqpException>(() => profile.CallOnCommand(command));

            exception.Error.Condition.ShouldBe((Symbol)ErrorCode.NotAllowed);
            exception.Message.ShouldBe(command.ToString());
        }
Example #3
0
        public void OnCommand_ReturnsSaslOutcomeOk_WhenCommandSaslInit()
        {
            var outcome = default(SaslOutcome);
            var profile = new AzureSaslProfileProxy();

            DescribedList result = profile.CallOnCommand(new SaslInit());

            result.ShouldSatisfyAllConditions(
                () => outcome = result.ShouldBeOfType <SaslOutcome>(),
                () => outcome.Code.ShouldBe(SaslCode.Ok)
                );
        }