public void ShouldIdentifyAs_Serial(Type type) { var identifier = new RequestProcessIdentifier(RequestProcessType.Parallel); var handler = Substitute.For <IHandlerDescriptor>(); handler.Handler.Returns((IJsonRpcHandler)Substitute.For(new Type[] { type }, new object[0])); handler.HandlerType.Returns(type); identifier.Identify(handler).Should().Be(RequestProcessType.Serial); }
public void ShouldIdentifyAs_Default() { var identifier = new RequestProcessIdentifier(RequestProcessType.Parallel); var handler = Substitute.For <IHandlerDescriptor>(); handler.Handler.Returns(Substitute.For <IJsonRpcHandler>()); handler.HandlerType.Returns(typeof(IJsonRpcHandler)); identifier.Identify(handler).Should().Be(RequestProcessType.Parallel); }