Exemplo n.º 1
0
        public void For_ParameterlessCtor_ShouldNotHaveAnyDependencies()
        {
            // Act
            var result = Arrange.For <AccountRepository>(type => new object());

            // Assert
            result.Dependencies.Should().BeEmpty();
        }
Exemplo n.º 2
0
        public void For_MultipleCtorsFound_ShouldThrowInvalidOperationException()
        {
            // Act
            Action act = () => Arrange.For <MultipleCtor>(type => new object());

            // Assert
            act.Should().Throw <InvalidOperationException>();
        }
Exemplo n.º 3
0
        public void For_ConcreteType_ShouldBuild()
        {
            // Act
            var result = Arrange.For <AccountRepository>();

            // Assert
            Action verify = () => result.BuildSut();

            verify.Should().NotThrow();
        }
Exemplo n.º 4
0
        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));
        }