public void CreateParameterThrowsExceptionWithNullParameter()
        {
            var executeStrategy = Substitute.For <IExecuteStrategy>();
            var valueGenerator  = Substitute.For <IValueGenerator>();

            var sut = new BuildCapability(valueGenerator);

            Action action = () => sut.CreateParameter(executeStrategy, null !, null);

            action.Should().Throw <ArgumentNullException>();
        }
        public void CreateParameterReturnsValueFromValueGenerator()
        {
            var parameterInfo = typeof(Person).GetConstructors()
                                .First(x => x.GetParameters().FirstOrDefault()?.Name == "firstName").GetParameters().First();
            var value = Guid.NewGuid().ToString();

            var executeStrategy = Substitute.For <IExecuteStrategy>();
            var valueGenerator  = Substitute.For <IValueGenerator>();

            valueGenerator.Generate(executeStrategy, parameterInfo)
            .Returns(value);

            var sut = new BuildCapability(valueGenerator);

            var actual = sut.CreateParameter(executeStrategy, parameterInfo, null);

            actual.Should().Be(value);
        }
        public void CreateParameterReturnsValueFromTypeCreator()
        {
            var parameterInfo = typeof(Person).GetConstructors()
                                .First(x => x.GetParameters().FirstOrDefault()?.Name == "firstName").GetParameters().First();
            var value = Guid.NewGuid().ToString();
            var args  = new object?[]
            {
                Guid.NewGuid().ToString(),
                Guid.NewGuid().ToString()
            };

            var executeStrategy = Substitute.For <IExecuteStrategy>();
            var typeCreator     = Substitute.For <ITypeCreator>();

            typeCreator.Create(executeStrategy, parameterInfo, args)
            .Returns(value);

            var sut = new BuildCapability(typeCreator, true, false);

            var actual = sut.CreateParameter(executeStrategy, parameterInfo, args);

            actual.Should().Be(value);
        }