public void OperationCallSetupDefinedForMessageTypeHasPrecedenceOverAction() { var sut = new OperationCallSetupCollection(); sut.Add <IWork>("Action"); var messageSetup = sut.Add <ISolicitResponse>("MessageType"); sut["MessageType", "Action"].Should().BeSameAs(messageSetup); }
public void OperationCallSetupDefinedForMessageTypeHasPrecedenceOverAction() { var sut = new OperationCallSetupCollection(); sut.Add <StubServiceFixture.IWork>("Action"); var messageSetup = sut.Add <ISolicitResponse>("MessageType"); Assert.That(sut["MessageType", "Action"], Is.SameAs(messageSetup)); }
public void AddOrUpdateOperationCallSetup() { var sut = new OperationCallSetupCollection(); var operationCallSetup1 = (OperationCallSetup <ISolicitResponse, Stream>)sut.Add <ISolicitResponse, Stream>("MessageType"); operationCallSetup1.Returns(new MemoryStream()); var operationCallSetup2 = (OperationCallSetup <ISolicitResponse, Stream>)sut.Add <ISolicitResponse, Stream>("MessageType"); operationCallSetup2.Returns(new MemoryStream()); Assert.That(sut["MessageType", "Action"], Is.SameAs(operationCallSetup2)); Assert.That(operationCallSetup1, Is.Not.SameAs(operationCallSetup2)); Assert.That(operationCallSetup1.Stream, Is.Not.SameAs(operationCallSetup2.Stream)); }
public void AddOrUpdateOperationCallSetup() { var sut = new OperationCallSetupCollection(); var operationCallSetup1 = (OperationCallSetup <ISolicitResponse, System.IO.Stream>)sut.Add <ISolicitResponse, System.IO.Stream>("MessageType"); operationCallSetup1.Returns(new MemoryStream()); var operationCallSetup2 = (OperationCallSetup <ISolicitResponse, System.IO.Stream>)sut.Add <ISolicitResponse, System.IO.Stream>("MessageType"); operationCallSetup2.Returns(new MemoryStream()); sut["MessageType", "Action"].Should().BeSameAs(operationCallSetup2); operationCallSetup1.Should().NotBeSameAs(operationCallSetup2); operationCallSetup1.Stream.Should().NotBeSameAs(operationCallSetup2.Stream); }