public void ShouldThrowIfNameIsNull()
        {
            // Arrange
            IStoreProcParamsBuilder builder = new StoreProcParamsBuilder();

            // Act & Assert
            Should.Throw<ArgumentNullException>(() => builder.WithOutParam<bool>(null, 100));
            Should.Throw<ArgumentNullException>(() => builder.WithInParam<bool>(null, true));
            Should.Throw<ArgumentNullException>(() => builder.WithInOutParam<bool>(null, true, 100));
        }
예제 #2
0
        public void ShouldThrowIfNameIsNull()
        {
            // Arrange
            IStoreProcParamsBuilder builder = new StoreProcParamsBuilder();

            // Act & Assert
            Should.Throw <ArgumentNullException>(() => builder.WithOutParam <bool>(null, 100));
            Should.Throw <ArgumentNullException>(() => builder.WithInParam <bool>(null, true));
            Should.Throw <ArgumentNullException>(() => builder.WithInOutParam <bool>(null, true, 100));
        }
        public void ShouldBuildWithInParam()
        {
            // Arrange
            IStoreProcParamsBuilder builder = new StoreProcParamsBuilder();

            // Act
            builder.WithInParam("name", 123);

            // Assert
            StoredProcParam param = builder.Build().First();
            param.Name.ShouldBe("name");
            param.Type.ShouldBe("integer");
            param.ParamType.ShouldBe("IN");
            param.Value.ShouldBe("123");
        }
예제 #4
0
        public void ShouldBuildWithInParam()
        {
            // Arrange
            IStoreProcParamsBuilder builder = new StoreProcParamsBuilder();

            // Act
            builder.WithInParam("name", 123);

            // Assert
            StoredProcParam param = builder.Build().First();

            param.name.ShouldBe("name");
            param.type.ShouldBe("integer");
            param.param_type.ShouldBe("IN");
            param.value.ShouldBe("123");
        }