示例#1
0
        public void DTOObjectSingleSelectMultipleRowMultipleColumnTest()
        {
            // Arrange
            var helper    = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, new List <Select> {
                new Select(new List <SelectColumn> {
                    new SelectColumn("col1", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "Int32?"), true),
                    new SelectColumn("col2", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "String"), true)
                }, false, null)
            });

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual(@"/// <summary>
/// DTO for the output of the ""proc"" stored procedure.
/// </summary>
public partial class procOutputDto
{
	public Int32? col1 { get; set; }
	public String col2 { get; set; }
}

", result);
        }
        public void DTOObjectSingleSelectMultipleRowMultipleColumnTest()
        {
            // Arrange
            var helper = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, new List<Select>{
                new Select(new List<SelectColumn>{
                    new SelectColumn("col1", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "Int32?"), true),
                    new SelectColumn("col2", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "String"), true)
                }, false, null)
            });

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual(@"/// <summary>
            /// DTO for the output of the ""proc"" stored procedure.
            /// </summary>
            public partial class procOutputDto
            {
            public Int32? col1 { get; set; }
            public String col2 { get; set; }
            }

            ", result);
        }
示例#3
0
        public void DTOObjectNoSelectTest()
        {
            // Arrange
            var helper    = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, null);

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual("", result);
        }
        public void DTOObjectNoSelectTest()
        {
            // Arrange
            var helper = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, null);

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual("", result);
        }
示例#5
0
        public void DTOObjectSingleSelectMultipleRowSingleColumnTest()
        {
            // Arrange
            var helper    = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, new List <Select> {
                new Select(new List <SelectColumn> {
                    new SelectColumn("col1", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "Int32?"), true)
                }, false, null)
            });

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual("", result);
        }
        public void DTOObjectSingleSelectMultipleRowSingleColumnTest()
        {
            // Arrange
            var helper = new ProcedureHelper();
            var procedure = new Procedure("proc", "proc", null, null, new List<Select>{
                new Select(new List<SelectColumn>{
                    new SelectColumn("col1", DataTypeHelper.Instance.GetMap(TypeFormat.DotNetFrameworkType, "Int32?"), true)
                }, false, null)
            });

            // Act
            var result = helper.GetDtoObject(procedure);

            // Assert
            Assert.AreEqual("", result);
        }