public void DefaultUnknownInboundAdapterFailsValidate() { var rlt = new ReceiveLocationTransport { Host = "Host" }; Assert.That( () => ((ISupportValidation)rlt).Validate(), Throws.TypeOf <BindingException>().With.Message.EqualTo("Transport's Adapter is not defined.")); }
public void DefaultUnknownInboundAdapterFailsValidate() { var rlt = new ReceiveLocationTransport <string>(new Mock <IReceiveLocation <string> >().Object) { Host = "Host" }; Invoking(() => ((ISupportValidation)rlt).Validate()) .Should().Throw <BindingException>() .WithMessage("Transport's Adapter is not defined."); }
public void ForwardsApplyEnvironmentOverridesToSchedule() { var scheduleMock = new Mock <Schedule>(); var environmentSensitiveScheduleMock = scheduleMock.As <ISupportEnvironmentOverride>(); var rlt = new ReceiveLocationTransport { Schedule = scheduleMock.Object }; ((ISupportEnvironmentOverride)rlt).ApplyEnvironmentOverrides("ACC"); environmentSensitiveScheduleMock.Verify(m => m.ApplyEnvironmentOverrides("ACC"), Times.Once); }
public void ForwardsApplyEnvironmentOverridesToSchedule() { var scheduleMock = new Mock <Schedule>(); var environmentSensitiveScheduleMock = scheduleMock.As <ISupportEnvironmentOverride>(); var rlt = new ReceiveLocationTransport <string>(new Mock <IReceiveLocation <string> >().Object) { Schedule = scheduleMock.Object }; ((ISupportEnvironmentOverride)rlt).ApplyEnvironmentOverrides(TargetEnvironment.ACCEPTANCE); environmentSensitiveScheduleMock.Verify(m => m.ApplyEnvironmentOverrides(TargetEnvironment.ACCEPTANCE), Times.Once); }
public void DelegatesHostNameResolutionToHostResolutionPolicy() { var receiveLocationMock = new Mock <IReceiveLocation <string> >(); var sut = new Mock <HostResolutionPolicy> { CallBase = true }; var rlt = new ReceiveLocationTransport <string>(receiveLocationMock.Object) { Host = sut.Object }; sut.Setup(p => p.ResolveHost(rlt)).Returns("name"); rlt.ResolveHost(); sut.Verify(p => p.ResolveHost(rlt)); }
protected internal ReceiveLocationBase() { _transport = new ReceiveLocationTransport(); }