public void MapTransformAdd() { const string xml = @" <add name='TestProcess'> <maps> <add name='Map'> <items> <add from='1' to='One' /> <add from='2' to='Two' /> <add from='3' parameter='Field3' /> </items> </add> </maps> <entities> <add name='TestData'> <rows> <add Field1='1' Field3='^' /> <add Field1='2' Field3='#' /> <add Field1='3' Field3='$THREE$' /> <add Field1='4' Field3='@' /> </rows> <fields> <add name='Field1' /> <add name='Field2' /> <add name='Field3' /> </fields> <calculated-fields> <add name='Map' t='copy(Field1).map(map)' default='None' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var field = composer.Process.Entities.First().CalculatedFields.First(); var output = controller.Read().ToArray(); Assert.AreEqual("One", output[0][field]); Assert.AreEqual("Two", output[1][field]); Assert.AreEqual("$THREE$", output[2][field]); Assert.AreEqual("None", output[3][field]); }
public void Validator() { const string xml = @" <add name='TestSignature'> <entities> <add name='TestData'> <rows> <add args='10,0' /> </rows> <fields> <add name='args' length='128'> <transforms> <add method='fromsplit' separator=','> <fields> <add name='TotalWidth' /> <add name='PaddingChar' /> </fields> </add> </transforms> </add> </fields> <calculated-fields> <add name='length' type='int' t='copy(args).splitlength(\,)' /> <add name='TotalWidthCheck' type='bool' t='copy(TotalWidth).is(int)' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var process = composer.Process; var output = controller.Read().ToArray(); var field = process.Entities.First().CalculatedFields.First(cf => cf.Name == "length"); Assert.AreEqual(2, output[0][field]); foreach (var row in output) { Console.WriteLine(row); } }
public void DoMath() { const string xml = @" <add name='TestProcess'> <entities> <add name='TestData' pipeline='linq'> <rows> <add Field1='10.6954' Field2='129.992' Field3='7' Field4='3' /> </rows> <fields> <add name='Field1' type='double' /> <add name='Field2' type='decimal' /> <add name='Field3' type='int' /> <add name='Field4' type='int' /> </fields> <calculated-fields> <add name='Ceiling' type='double' t='copy(Field1).ceiling()' /> <add name='Floor' type='double' t='copy(Field1).floor()' /> <add name='Round' type='decimal' t='copy(Field2).round(1)' /> <add name='Abs' type='decimal' t='copy(Field2).abs()' /> <add name='Add' type='decimal' t='copy(Field1,Field2,Field3).add()' /> <add name='AddInts' type='int' t='copy(Field3,Field4).add()' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); var cf = composer.Process.Entities.First().CalculatedFields.ToArray(); var row = output.First(); Assert.AreEqual(11, row[cf[0]]); Assert.AreEqual(10, row[cf[1]]); Assert.AreEqual(130.00d, row[cf[2]]); Assert.AreEqual(129.992, row[cf[3]]); Assert.AreEqual(147.6874m, row[cf[4]]); Assert.IsInstanceOf <int>(row[cf[5]]); Assert.AreEqual(10, row[cf[5]]); }
// ReSharper disable once InconsistentNaming public void IIfTransform1() { const string xml = @" <add name='TestProcess'> <entities> <add name='TestData'> <rows> <add Field1='2' Field2='1' Field3='3' Field4='4' Field5='rockstar' Field6='rock' /> <add Field1='2' Field2='2' Field3='3' Field4='4' Field5='rockstars' Field6='star' /> </rows> <fields> <add name='Field1' type='int' /> <add name='Field2' type='int' /> <add name='Field3' type='int' /> <add name='Field4' type='int' /> <add name='Field5' /> <add name='Field6' /> </fields> <calculated-fields> <add name='Equal' type='int' t='iif(Field1=Field2,Field3,Field4)' /> <add name='GreaterThan' type='int' t='iif(Field1 > Field2,Field3,Field4)' /> <add name='StartsWith' type='int' t='iif(Field5 ^= Field6,Field3,Field4)' /> <add name='Contains' type='int' t='iif(Field5*=Field6,Field3,Field4)' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); var cf = composer.Process.Entities.First().CalculatedFields; Assert.AreEqual(4, output[0][cf.First(f => f.Name == "Equal")], "Should be 4 because Field1 and Field2 are not equal."); Assert.AreEqual(3, output[1][cf.First(f => f.Name == "Equal")], "Should be 3 because Field1 and Field2 are equal."); Assert.AreEqual(3, output[0][cf.First(f => f.Name == "GreaterThan")], "Should be 3 because Field1 is greater than Field2."); Assert.AreEqual(4, output[1][cf.First(f => f.Name == "GreaterThan")], "Should be 4 because Field1 is NOT greater than Field2."); Assert.AreEqual(3, output[0][cf.First(f => f.Name == "StartsWith")], "Should be 3 because Field5 starts with Field6."); Assert.AreEqual(4, output[1][cf.First(f => f.Name == "StartsWith")], "Should be 4 because Field5 does not start with Field6."); }
public void Try1() { const string xml = @" <add name='name'> <entities> <add name='Employee'> <rows> <add EmpId='1' FirstName='John' LastName='Doe' JobId='1' /> <add EmpId='2' FirstName='Jane' LastName='Doe' JobId='2' /> </rows> <fields> <add name='EmpId' type='int' primary-key='true' /> <add name='FirstName' /> <add name='LastName' /> <add name='JobId' type='int' /> </fields> <calculated-fields> <add name='FullName' t='copy(FirstName,LastName).format({0} {1})' /> </calculated-fields> </add> <add name='Job'> <rows> <add JobId='1' Title='Carpenter' /> <add JobId='2' Title='Seamstress' /> </rows> <fields> <add name='JobId' type='int' primary-key='true' /> <add name='Title' /> </fields> </add> </entities> <relationships> <add left-entity='Employee' left-field='JobId' right-entity='Job' right-field='JobId' /> </relationships> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); Assert.AreEqual(2, output.Length); }
public void Try1() { const string xml = @" <add name='TestProcess'> <entities> <add name='TestData'> <rows> <add id='1' xml=""<things><add name='deez'/><add name='nutz'/></things>"" /> <add id='2' xml=""<things><add name='got'/><add name='eeee'/></things>"" /> </rows> <fields> <add name='id' type='int' /> <add name='xml' length='max'> <transforms> <add method='fromxml' root='things' xml-mode='all'> <fields> <add name='name' node-type='attribute' /> </fields> </add> </transforms> </add> </fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); Assert.AreEqual(4, output.Length); var name = composer.Process.Entities.First().CalculatedFields.First(); var first = output[0]; Assert.AreEqual("deez", first[name]); var second = output[1]; Assert.AreEqual("nutz", second[name]); }
public void Test1() { const string xml = @"<cfg> <processes> <add name='one' mode='init'> <connections> <add name='input' provider='solr' server='***change-me***' port='8080' path='solr' core='TimeCard' /> </connections> <entities> <add name='TimeCard'> <filter> <add expression='fullnamesearch:christ' /> </filter> <fields> <add name='tflkey' alias='key' type='int' /> <add name='tflbatchid' alias='batchid' type='int' /> <add name='tfldeleted' alias='deleted' type='bool' /> <add name='tflhashcode' alias='hashcode' type='int' /> <add name='exportcode' /> <add name='weekending' /> <add name='costcode' /> <add name='jobcode' /> <add name='acct' /> <add name='sub' /> <add name='regularhours' type='decimal' /> <add name='overtimehours' type='decimal' /> <add name='worklocation' /> <add name='firstname' /> <add name='lastname' /> </fields> </add> </entities> </add> </processes> </cfg>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var rows = controller.Read().ToArray(); Assert.AreEqual(2, rows.Length); }
public void DateDiff1() { var xml = @" <add name='TestProcess'> <entities> <add name='TestData' > <rows> <add StartDate='2016-06-01' EndDate='2016-08-01' /> </rows> <fields> <add name='StartDate' type='datetime' /> <add name='EndDate' type='datetime' /> </fields> <calculated-fields> <add name='Years' type='int' t='copy(StartDate,EndDate).datediff(year)' /> <add name='Days' type='int' t='copy(StartDate,EndDate).datediff(day)' /> <add name='Minutes' type='int' t='copy(StartDate,EndDate).datediff(minute)' /> <add name='Hours' type='double' t='copy(StartDate,EndDate).datediff(hour)' /> <add name='MovingUtc' type='int' t='copy(EndDate).datediff(hour,UTC)' /> <add name='MovingEst' type='int' t='copy(EndDate).datediff(hour,Eastern Standard Time)' /> </calculated-fields> </add> </entities> </add> ".Replace('\'', '"'); var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); var cf = composer.Process.Entities.First().CalculatedFields.ToArray(); Assert.AreEqual(0, output[0][cf[0]]); Assert.AreEqual(61, output[0][cf[1]]); Assert.AreEqual(87840, output[0][cf[2]]); Assert.AreEqual(1464, output[0][cf[3]]); //Assert.AreEqual(1640, output[0][cf[4]]); //Assert.AreEqual(1644, output[0][cf[5]]); }
public void AnyEqual() { var xml = @" <add name='TestProcess'> <entities> <add name='TestData' pipeline='linq'> <rows> <add Field1='1' Field2='2' Field3='3' /> </rows> <fields> <add name='Field1' /> <add name='Field2' /> <add name='Field3' /> </fields> <calculated-fields> <add name='Has1' type='bool' t='copy(*).any(1)' /> <add name='Has2' type='bool' t='copy(Field1,Field2,Field3).any(2)' /> <add name='Has3' type='bool' t='copy(*).any(3)' /> <add name='Has4' type='bool' t='copy(Field1,Field2,Field3).any(4)' /> </calculated-fields> </add> </entities> </add> ".Replace('\'', '"'); var composer = new CompositionRoot(); var controller = composer.Compose(xml); var output = controller.Read().ToArray(); var cf = composer.Process.Entities.First().CalculatedFields.ToArray(); Assert.AreEqual(true, output[0][cf[0]]); Assert.AreEqual(true, output[0][cf[1]]); Assert.AreEqual(true, output[0][cf[2]]); Assert.AreEqual(false, output[0][cf[3]]); }
public void Test() { const string xml = @" <add name='TestProcess'> <connections> <add name='input' provider='web' url='' user='' password='' /> <add name='output' provider='log' /> </connections> <entities> <add name='TestData' > <fields> <add name='Content' length='max' output='false'> <transforms> <add method='fromXml' xml-mode='all'> <fields> <add name='name' node-type='attribute' /> <add name='consumerCount' type='int' node-type='attribute' /> </fields> </add> </transforms> </add> </fields> <calculated-fields> <add name='pass' type='bool' t='copy(pass,consumerCount).js(consumerCount > 0).filter(false)' /> <add name='message' length='128' t='copy(name,consumerCount).format({0} queue has {1} consumers!)' /> <add name='level' default='error' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); controller.Execute(); }
public void TrySomeDateMath() { const string xml = @" <add name='TestDateMath'> <entities> <add name='Dates'> <rows> <add Date='2017-01-01 9 AM' /> <add Date='2016-06-07 12:31:22' /> </rows> <fields> <add name='Date' type='datetime' /> </fields> <calculated-fields> <add name='RoundToMonth' type='datetime' t='copy(Date).dateMath(/M)' /> <add name='AddOneHourOneMinute' type='datetime' t='copy(Date).DateMath(+1h+1m)' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); controller.Execute(); var process = composer.Process; var row1 = process.Entities.First().Rows[0]; var row2 = process.Entities.First().Rows[1]; Assert.AreEqual(new DateTime(2017, 1, 1, 0, 0, 0), row1["RoundToMonth"]); Assert.AreEqual(new DateTime(2017, 1, 1, 10, 1, 0), row1["AddOneHourOneMinute"]); Assert.AreEqual(new DateTime(2016, 6, 1, 0, 0, 0), row2["RoundToMonth"]); Assert.AreEqual(new DateTime(2016, 6, 7, 13, 32, 22), row2["AddOneHourOneMinute"]); }
public void RunInit() { var composer = new CompositionRoot(); composer.Compose(Cfg + @"?Mode=init", LogLevel.Info).Execute(); }
public void StarSql() { var composer = new CompositionRoot(); var controller = composer.Compose(@"Files\Northwind.xml"); Assert.AreEqual(0, composer.Process.Errors().Length); var pipe = new PipelineContext(new TraceLogger(), composer.Process); var actual = new SqlFormattingManager().Format(pipe.SqlCreateStarView(new SqlServerConnectionFactory(new Connection().WithDefaults()))); Assert.IsNotNull(controller); const string expected = @"CREATE VIEW [NorthWindStar] AS SELECT A.[A1] AS [TflKey] ,A.[A2] AS [TflBatchId] ,A.[A3] AS [TflHashCode] ,A.[A4] AS [TflDeleted] ,A.[A5] AS [OrderDetailsDiscount] ,A.[A6] AS [OrderDetailsOrderID] ,A.[A7] AS [OrderDetailsProductID] ,A.[A8] AS [OrderDetailsQuantity] ,A.[A9] AS [OrderDetailsRowVersion] ,A.[A10] AS [OrderDetailsUnitPrice] ,A.[A11] AS [OrderDetailsExtendedPrice] ,A.[A20] AS [CountryExchange] ,A.[A21] AS [Test] ,A.[B5] AS [OrdersCustomerID] ,A.[B6] AS [OrdersEmployeeID] ,A.[E12] AS [ProductsSupplierID] ,A.[E5] AS [ProductsCategoryID] ,A.[B19] AS [OrdersShipVia] ,COALESCE(B.[B7], 0.0) AS [OrdersFreight] ,COALESCE(B.[B8], '9999-12-31T00:00:00Z') AS [OrdersOrderDate] ,COALESCE(B.[B10], '9999-12-31T00:00:00Z') AS [OrdersRequiredDate] ,COALESCE(B.[B12], '') AS [OrdersShipAddress] ,COALESCE(B.[B13], '') AS [OrdersShipCity] ,COALESCE(B.[B14], '') AS [OrdersShipCountry] ,COALESCE(B.[B15], '') AS [OrdersShipName] ,COALESCE(B.[B16], '9999-12-31T00:00:00Z') AS [OrdersShippedDate] ,COALESCE(B.[B17], '') AS [OrdersShipPostalCode] ,COALESCE(B.[B18], '') AS [OrdersShipRegion] ,COALESCE(B.[B20], '12-DEC') AS [TimeOrderMonth] ,COALESCE(B.[B21], '9999-12-31') AS [TimeOrderDate] ,COALESCE(B.[B22], '9999') AS [TimeOrderYear] ,COALESCE(C.[C5], '') AS [CustomersAddress] ,COALESCE(C.[C6], '') AS [CustomersCity] ,COALESCE(C.[C7], '') AS [CustomersCompanyName] ,COALESCE(C.[C8], '') AS [CustomersContactName] ,COALESCE(C.[C9], '') AS [CustomersContactTitle] ,COALESCE(C.[C10], '') AS [CustomersCountry] ,COALESCE(C.[C12], '') AS [CustomersFax] ,COALESCE(C.[C13], '') AS [CustomersPhone] ,COALESCE(C.[C14], '') AS [CustomersPostalCode] ,COALESCE(C.[C15], '') AS [CustomersRegion] ,COALESCE(D.[D5], '') AS [EmployeesAddress] ,COALESCE(D.[D6], '9999-12-31T00:00:00Z') AS [EmployeesBirthDate] ,COALESCE(D.[D7], '') AS [EmployeesCity] ,COALESCE(D.[D8], '') AS [EmployeesCountry] ,COALESCE(D.[D10], '') AS [EmployeesExtension] ,COALESCE(D.[D11], '') AS [EmployeesFirstName] ,COALESCE(D.[D12], '9999-12-31T00:00:00Z') AS [EmployeesHireDate] ,COALESCE(D.[D13], '') AS [EmployeesHomePhone] ,COALESCE(D.[D14], '') AS [EmployeesLastName] ,COALESCE(D.[D15], '') AS [EmployeesNotes] ,COALESCE(D.[D18], '') AS [EmployeesPostalCode] ,COALESCE(D.[D19], '') AS [EmployeesRegion] ,COALESCE(D.[D21], '') AS [EmployeesTitle] ,COALESCE(D.[D22], '') AS [EmployeesTitleOfCourtesy] ,COALESCE(D.[D23], 0) AS [EmployeesReportsTo] ,COALESCE(D.[D24], '') AS [EmployeesManager] ,COALESCE(D.[D25], '') AS [Employee] ,COALESCE(E.[E6], 0) AS [ProductsDiscontinued] ,COALESCE(E.[E8], '') AS [ProductsProductName] ,COALESCE(E.[E9], '') AS [ProductsQuantityPerUnit] ,COALESCE(E.[E10], 0) AS [ProductsReorderLevel] ,COALESCE(E.[E13], 0.0) AS [ProductsUnitPrice] ,COALESCE(E.[E14], 0) AS [ProductsUnitsInStock] ,COALESCE(E.[E15], 0) AS [ProductsUnitsOnOrder] ,COALESCE(F.[F5], '') AS [SuppliersAddress] ,COALESCE(F.[F6], '') AS [SuppliersCity] ,COALESCE(F.[F7], '') AS [SuppliersCompanyName] ,COALESCE(F.[F8], '') AS [SuppliersContactName] ,COALESCE(F.[F9], '') AS [SuppliersContactTitle] ,COALESCE(F.[F10], '') AS [SuppliersCountry] ,COALESCE(F.[F11], '') AS [SuppliersFax] ,COALESCE(F.[F12], '') AS [SuppliersHomePage] ,COALESCE(F.[F13], '') AS [SuppliersPhone] ,COALESCE(F.[F14], '') AS [SuppliersPostalCode] ,COALESCE(F.[F15], '') AS [SuppliersRegion] ,COALESCE(G.[G6], '') AS [CategoriesCategoryName] ,COALESCE(G.[G7], '') AS [CategoriesDescription] ,COALESCE(H.[H5], '') AS [ShippersCompanyName] ,COALESCE(H.[H6], '') AS [ShippersPhone] FROM [NorthWindOrder DetailsTable] A LEFT OUTER JOIN [NorthWindOrdersTable] B ON (A.[A6] = B.[B9]) LEFT OUTER JOIN [NorthWindCustomersTable] C ON (A.[B5] = C.[C11]) LEFT OUTER JOIN [NorthWindEmployeesTable] D ON (A.[B6] = D.[D9]) LEFT OUTER JOIN [NorthWindProductsTable] E ON (A.[A7] = E.[E7]) LEFT OUTER JOIN [NorthWindSuppliersTable] F ON (A.[E12] = F.[F17]) LEFT OUTER JOIN [NorthWindCategoriesTable] G ON (A.[E5] = G.[G5]) LEFT OUTER JOIN [NorthWindShippersTable] H ON (A.[B19] = H.[H8]); "; Assert.AreEqual(expected, actual); }
public void HumanizeTranformTests() { var date = DateTime.UtcNow.AddMonths(2).ToString("O"); var now = DateTime.UtcNow.ToString("O"); var xml = $@" <add name='TestProcess'> <entities> <add name='TestData'> <rows> <add text='sample text' date='{date}' metric='1k' roman='XXXVIII' number='1' /> <add text='Sample_Texts' date='{date}' metric='16 twerps' roman='P' number='22' /> <add text='$ample-text' date='{now}' metric='1000 μ' roman='CC' number='3000' /> </rows> <fields> <add name='text' /> <add name='date' type='datetime' /> <add name='metric' /> <add name='roman' /> <add name='number' type='int' /> </fields> <calculated-fields> <add name='Humanized' t='copy(text).humanize()' /> <add name='Dehumanized' t='copy(text).dehumanize()' /> <add name='HumanizedDate' t='copy(date).addminutes(30.1).humanize()' /> <add name='Camelized' t='copy(text).camelize()' /> <add name='FromMetric' type='double' t='copy(metric).fromMetric()' /> <add name='FromRoman' type='double' t='copy(roman).fromRoman()' /> <add name='Hyphenated' t='copy(text).hyphenate()' /> <add name='Ordinalized' t='copy(number).ordinalize()' /> <add name='Pascalized' t='copy(text).pascalize()' /> <add name='Pluralized' t='copy(text).pluralize()' /> <add name='Singularized' t='copy(text).singularize()' /> <add name='Titleized' t='copy(text).titleize()' /> <add name='ToMetric' t='copy(number).tometric()' /> <add name='ToOrdinalWorded' t='copy(number).toOrdinalWords()' /> <add name='ToRoman' t='copy(number).toRoman()' /> <add name='ToWords' t='copy(number).toWords()' /> <add name='Underscored' t='copy(text).underscore()' /> </calculated-fields> </add> </entities> </add>"; var composer = new CompositionRoot(); var controller = composer.Compose(xml); var cf = composer.Process.Entities.First().CalculatedFields; var humanized = cf.First(); var dehumanized = cf.First(f => f.Name == "Dehumanized"); var humanizedDate = cf.First(f => f.Name == "HumanizedDate"); var camelized = cf.First(f => f.Name == "Camelized"); var fromMetric = cf.First(f => f.Name == "FromMetric"); var fromRoman = cf.First(f => f.Name == "FromRoman"); var hyphenated = cf.First(f => f.Name == "Hyphenated"); var ordinalized = cf.First(f => f.Name == "Ordinalized"); var pascalized = cf.First(f => f.Name == "Pascalized"); var pluralized = cf.First(f => f.Name == "Pluralized"); var singularized = cf.First(f => f.Name == "Singularized"); var titleized = cf.First(f => f.Name == "Titleized"); var toMetric = cf.First(f => f.Name == "ToMetric"); var toOrdinalWorded = cf.First(f => f.Name == "ToOrdinalWorded"); var toRoman = cf.First(f => f.Name == "ToRoman"); var toWords = cf.First(f => f.Name == "ToWords"); var underscored = cf.First(f => f.Name == "Underscored"); var rows = controller.Read().ToArray(); Assert.AreEqual("Sample text", rows[0][humanized]); Assert.AreEqual("Sample Texts", rows[1][humanized]); Assert.AreEqual("$ample text", rows[2][humanized]); Assert.AreEqual("SampleText", rows[0][dehumanized]); Assert.AreEqual("SampleTexts", rows[1][dehumanized]); Assert.AreEqual("$ampleText", rows[2][dehumanized]); Assert.AreEqual("2 months from now", rows[0][humanizedDate]); Assert.AreEqual("2 months from now", rows[1][humanizedDate]); Assert.AreEqual("30 minutes from now", rows[2][humanizedDate]); Assert.AreEqual("sample text", rows[0][camelized]); Assert.AreEqual("sampleTexts", rows[1][camelized]); Assert.AreEqual("$ample-text", rows[2][camelized]); Assert.AreEqual(1000d, rows[0][fromMetric]); Assert.AreEqual(16d, rows[1][fromMetric]); Assert.AreEqual(0.001d, rows[2][fromMetric]); Assert.AreEqual(38.0d, rows[0][fromRoman]); Assert.AreEqual(0d, rows[1][fromRoman]); Assert.AreEqual(200d, rows[2][fromRoman]); Assert.AreEqual("sample text", rows[0][hyphenated]); Assert.AreEqual("Sample-Texts", rows[1][hyphenated]); Assert.AreEqual("$ample-text", rows[2][hyphenated]); Assert.AreEqual("1st", rows[0][ordinalized]); Assert.AreEqual("22nd", rows[1][ordinalized]); Assert.AreEqual("3000th", rows[2][ordinalized]); Assert.AreEqual("Sample text", rows[0][pascalized]); Assert.AreEqual("SampleTexts", rows[1][pascalized]); Assert.AreEqual("$ample-text", rows[2][pascalized]); Assert.AreEqual("sample texts", rows[0][pluralized]); Assert.AreEqual("Sample_Texts", rows[1][pluralized]); Assert.AreEqual("$ample-texts", rows[2][pluralized]); Assert.AreEqual("sample text", rows[0][singularized]); Assert.AreEqual("Sample_Text", rows[1][singularized]); Assert.AreEqual("$ample-text", rows[2][singularized]); Assert.AreEqual("Sample Text", rows[0][titleized]); Assert.AreEqual("Sample Texts", rows[1][titleized]); Assert.AreEqual("$ample Text", rows[2][titleized]); Assert.AreEqual("1", rows[0][toMetric]); Assert.AreEqual("22", rows[1][toMetric]); Assert.AreEqual("3k", rows[2][toMetric]); Assert.AreEqual("first", rows[0][toOrdinalWorded]); Assert.AreEqual("twenty-second", rows[1][toOrdinalWorded]); Assert.AreEqual("three thousandth", rows[2][toOrdinalWorded]); Assert.AreEqual("I", rows[0][toRoman]); Assert.AreEqual("XXII", rows[1][toRoman]); Assert.AreEqual("MMM", rows[2][toRoman]); Assert.AreEqual("one", rows[0][toWords]); Assert.AreEqual("twenty-two", rows[1][toWords]); Assert.AreEqual("three thousand", rows[2][toWords]); Assert.AreEqual("sample_text", rows[0][underscored]); Assert.AreEqual("sample_texts", rows[1][underscored]); Assert.AreEqual("$ample_text", rows[2][underscored]); /* * sample text' * Sample_Texts * $ample-text' */ }