public void ConstructWithNullProcedureName_ThrowsException()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();

            // ACT
            new StoredProcedureWithParameters(null, parameters);

            // ASSERT
            Assert.Fail();
        }
        public void ConstructWithEmptyProcedureName_ThrowsArgumentOutOfRangeException()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();

            // ACT
            new StoredProcedureWithParameters(string.Empty, parameters);

            // ASSERT
            Assert.Fail();
        }
        public void ConstructWithProcedureAndEmptySchemaName_ThrowsArgumentOutOfRangeException()
        {
            // ARRANGE
            const string expectedProcedureName = "GetAllMonkeys";
            var parameters = new StoredProcedureWithParameters.BasicParameters();

            // ACT
            new StoredProcedureWithParameters(string.Empty, expectedProcedureName, parameters);

            // ASSERT
            Assert.Fail();
        }
        public void SetSchema_WithValidValue_CheckSchemaProperty_ReturnsCorrect()
        {
            // ARRANGE
            const string expectedValue = "TestSchema";
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(parameters);

            // ACT
            procedure.SetSchemaName(expectedValue);
            var actualValue = procedure.SchemaName;

            // ASSERT
            Assert.AreEqual(expectedValue, actualValue);
        }
        public void SetSchema_WithNullValue_ThrowsArgumentNullException()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(parameters);

            // ACT
            procedure.SetSchemaName(null);

            // ASSERT
            Assert.Fail("ArgumentOutOfRangeException not encountered");
        }
        public void SetName_WithInvalidValue_ThrowsArgumentOutOfRangeException()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(parameters);

            // ACT
            procedure.SetProcedureName(string.Empty);

            // ASSERT
            Assert.Fail("ArgumentOutOfRangeException not encountered");
        }
        public void IsFullyConstructed_WhenProcedureNameNotSet_ReturnsTrue()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(parameters);

            // ACT
            var actualvalue = procedure.IsFullyConstructed();

            // ASSERT
            Assert.IsTrue(actualvalue);
        }
        public void IsFullyConstructed_WhenNameSet_ReturnsTrue()
        {
            // ARRANGE
            const string procedureName = "GetAllMonkeys";
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(procedureName, parameters);

            // ACT
            var actualvalue = procedure.IsFullyConstructed();

            // ASSERT
            Assert.IsTrue(actualvalue);
        }
        public void GetTwoPartName_WhenConstructedWithProcedureName_ReturnsCorrectly()
        {
            // ARRANGE
            const string expectedSchemaName = StoredProcedureDefaults.DefaultSchemaName;
            const string expectedProcedureName = "GetAllMonkeys";
            string expectedTwoPartName = String.Concat(
                expectedSchemaName,
                StoredProcedureDefaults.DotIdentifier,
                expectedProcedureName);
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(expectedProcedureName, parameters);

            // ACT
            var actualTwoPartName = procedure.GetTwoPartName();

            // ASSERT
            Assert.AreEqual(expectedTwoPartName, actualTwoPartName);
        }
        public void EnsureFullyConstructed_WhenConstructedWithParamerters_DoesNotThrowException()
        {
            // ARRANGE
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(parameters);

            // ACT
            procedure.EnsureIsFullyConstructed();

            // ASSERT
        }
        public void ConstructWithProcedureName_CheckProcedureNameProperty_ReturnsCorrect()
        {
            // ARRANGE
            const string expectedSchemaName = StoredProcedureDefaults.DefaultSchemaName;
            const string expectedProcedureName = "GetAllMonkeys";
            var parameters = new StoredProcedureWithParameters.BasicParameters();
            var procedure = new StoredProcedureWithParameters(expectedProcedureName, parameters);

            // ACT
            var actualSchemaName = procedure.SchemaName;

            // ASSERT
            Assert.AreEqual(expectedSchemaName, actualSchemaName);
        }