public void For_ParameterlessCtor_ShouldNotHaveAnyDependencies() { // Act var result = Arrange.For <AccountRepository>(type => new object()); // Assert result.Dependencies.Should().BeEmpty(); }
public void For_MultipleCtorsFound_ShouldThrowInvalidOperationException() { // Act Action act = () => Arrange.For <MultipleCtor>(type => new object()); // Assert act.Should().Throw <InvalidOperationException>(); }
public void For_ConcreteType_ShouldBuild() { // Act var result = Arrange.For <AccountRepository>(); // Assert Action verify = () => result.BuildSut(); verify.Should().NotThrow(); }
public void For_CtorWithParameters_ShouldReturnFluentArrangeObjectWithDependency() { // Arrange var dependency = new AccountRepository(); // Act var result = Arrange.For <AccountService>(type => dependency); // Assert result.Dependencies.Values.Should().SatisfyRespectively(first => first.Should().Be(dependency)); }