public void Typical(CheckIsDelegateFactory sut) { sut.Check(typeof(ClassWithFactory.Factory)) .Should().BeTrue(); sut.ValidateTypeCtor.Received(1).Validate(typeof(ClassWithFactory), Arg.Is <HashSet <string> >(x => x.SetEquals("str", "i"))); sut.ValidateType.Received(1).Validate(typeof(ClassWithFactory), false); }
public void InterfaceReturnNoValidationNeeded(CheckIsDelegateFactory sut) { sut.Registrations.Items.TryGetValue(typeof(IClassWithFactory), out _).Returns(x => { x[1] = new List <Registration>() { new(typeof(ClassWithFactory), false) }; return(true); }); sut.Check(typeof(ClassWithFactory.InterfaceFactory)) .Should().BeTrue(); sut.ValidateTypeCtor.DidNotReceiveWithAnyArgs().Validate(default !);
public void InterfaceReturn(CheckIsDelegateFactory sut) { sut.Registrations.Items.TryGetValue(typeof(IClassWithFactory), out _).Returns(x => { x[1] = new List <Registration>() { new(typeof(ClassWithFactory), true) }; return(true); }); sut.Check(typeof(ClassWithFactory.InterfaceFactory)) .Should().BeTrue(); sut.ValidateTypeCtor.Received(1).Validate(typeof(ClassWithFactory), Arg.Is <HashSet <string> >(x => x.SetEquals("str", "i"))); sut.ValidateType.Received(1).Validate(typeof(IClassWithFactory), false); }