public void GetFieldsStructureTest() { FieldsStructureReaderService service = new FieldsStructureReaderService("V"); Fields fields = service.Get(); Assert.NotNull(fields); Assert.NotEmpty(fields.Items); foreach (FieldItem item in fields.Items) { this.Output.WriteLine( $"Name - {item.FieldName}, Type - {item.FieldType.GetType().ToString()}, Nullable Condition - {item.IsNullableCondition}"); } }
/// <summary> /// This function returns TRUE if all fields structure collection has been read successfully. /// </summary> /// <returns></returns> private bool GetFieldsStructureCollection() { try { FieldsStructureReaderService service = new FieldsStructureReaderService(this.Model); this.FieldsCollection = service.Get(); if (!this.FieldsCollection.Items.Any()) { throw new ArgumentNullException($"There ara no any fields found at all."); } } catch (Exception ex) { this.AddErrorMessage($"Fields structure initialization process: {ex.Message}"); } return(this.IsValid); }
public void ReadCsvFileToProfilerTest() { FieldsStructureReaderService service = new FieldsStructureReaderService("V"); var source = service.GetCsvData(); Assert.NotEmpty(source); foreach (FileStructureProfile item in source) { this.Output .WriteLine($"Model: {item.Model}, " + $"Condition: {item.Condition}, - " + $"FileName: {item.File}, " + $"Order: {item.Order}, " + $"Field: {item.FieldName}, " + $"KEY Field: {item.FieldNameKey}, " + $"Type: {item.FieldType}, " + $"Max Length: {item.MaxLength}"); } }
public void ServiceReaderInstanceTest() { FieldsStructureReaderService service = new FieldsStructureReaderService("M"); Assert.Equal("fields_structure.csv", service.FileName); }
protected Fields GetFieldsStructureCollection(string model) { FieldsStructureReaderService service = new FieldsStructureReaderService(model); return(service.Get()); }
private Fields GetFields() { FieldsStructureReaderService service = new FieldsStructureReaderService("V"); return(service.Get()); }