예제 #1
0
        public void AssertHasValue_WithDataRowNull()
        {
            //Arrange
            DataRow dataRow       = null;
            string  columnName    = "Column1";
            string  rowIdentifier = Guid.NewGuid().ToString();

            // Action
            DataRowExtensions.AssertHasValue <string>(dataRow, columnName, rowIdentifier);
        }
예제 #2
0
        public void AssertHasValue_WithColumnNameStringEmpty()
        {
            //Arrange
            var dataTable = new DataTable();

            string columnName = string.Empty;
            var    dataColumn = new DataColumn(columnName);

            dataTable.Columns.Add(dataColumn);

            var dataRow = dataTable.NewRow();

            // Action
            DataRowExtensions.AssertHasValue <string>(dataRow, columnName);
        }
예제 #3
0
        public void AssertHasValue_WithValue()
        {
            //Arrange
            var dataTable = new DataTable();

            string columnName = "Column1";
            var    dataColumn = new DataColumn(columnName);

            dataTable.Columns.Add(dataColumn);

            var dataRow = dataTable.NewRow();

            dataRow[dataColumn] = Guid.NewGuid().ToString();

            // Action
            DataRowExtensions.AssertHasValue(dataRow, columnName);
        }
예제 #4
0
        public void AssertHasValue_WithNullValue()
        {
            //Arrange
            var dataTable = new DataTable();

            string columnName = "Column1";
            var    dataColumn = new DataColumn(columnName);

            dataTable.Columns.Add(dataColumn);

            var dataRow = dataTable.NewRow();

            dataRow[dataColumn] = null;

            // Action
            DataRowExtensions.AssertHasValue <string>(dataRow, columnName);
        }
예제 #5
0
        public void AssertHasValue_WithNonMatchingTypeValue()
        {
            //Arrange
            var dataTable = new DataTable();

            string columnName = "Column1";
            var    dataColumn = new DataColumn(columnName, typeof(Guid));

            dataTable.Columns.Add(dataColumn);

            var dataRow = dataTable.NewRow();

            dataRow[dataColumn] = Guid.NewGuid();

            // Action
            DataRowExtensions.AssertHasValue <string>(dataRow, columnName);
        }