public void OnCommand_ReturnsNull_WhenCommandSaslMechanism() { var profile = new AzureSaslProfileProxy(); DescribedList result = profile.CallOnCommand(new SaslMechanisms()); result.ShouldBeNull(); }
public void UpgradeTransport_ReturnsTheSameTransportInstance() { ITransport transport = Substitute.For <ITransport>(); var profile = new AzureSaslProfileProxy(); ITransport result = profile.CallUpgradeTransport(transport); result.ShouldBeSameAs(transport); }
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()); }
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) ); }
public void GetStartCommand_ReturnsSaslInitWithCorrectSettings() { var saslInit = default(SaslInit); var profile = new AzureSaslProfileProxy(); DescribedList command = profile.CallGetStartCommand("hostname1"); command.ShouldSatisfyAllConditions( () => saslInit = command.ShouldBeOfType <SaslInit>(), () => saslInit.Mechanism.ShouldBe((Symbol)"MSSBCBS"), () => saslInit.InitialResponse.ShouldBe(Encoding.UTF8.GetBytes("MSSBCBS")) ); }