public void ReplacePropertyAtTest3() { var wrapper = new CsvRecordWrapper(); const string prop1Name = "Prop1"; const string prop2Name = "Prop2"; const string prop3Name = "Prop3"; var prop1 = new CsvProperty(prop1Name, new string[] { "Hallo1" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); var prop2 = new CsvProperty(prop2Name, new string[] { "Hallo2" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); var prop3 = new CsvProperty(prop3Name, new string[] { "Hallo3" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); wrapper.AddProperty(prop1); wrapper.AddProperty(prop2); wrapper.ReplacePropertyAt(4711, prop3); }
public void ReplacePropertyAtTest1() { var wrapper = new CsvRecordWrapper(); const string prop1Name = "Prop1"; const string prop2Name = "Prop2"; const string prop3Name = "Prop3"; var prop1 = new CsvProperty(prop1Name, new string[] { "Hallo1" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); var prop2 = new CsvProperty(prop2Name, new string[] { "Hallo2" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); var prop3 = new CsvProperty(prop3Name, new string[] { "Hallo3" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); wrapper.AddProperty(prop1); wrapper.AddProperty(prop2); Assert.AreEqual(2, wrapper.Count); Assert.AreEqual(prop1Name, wrapper.PropertyNames[0]); Assert.AreEqual(prop2Name, wrapper.PropertyNames[1]); wrapper.ReplacePropertyAt(0, prop3); Assert.AreEqual(2, wrapper.Count); Assert.AreEqual(prop3Name, wrapper.PropertyNames[0]); Assert.AreEqual(prop2Name, wrapper.PropertyNames[1]); }
public void ReplacePropertyAtTest4() { var wrapper = new CsvRecordWrapper(); const string prop1Name = "Prop1"; var prop1 = new CsvProperty(prop1Name, new string[] { "Hallo1" }, Converters.CsvConverterFactory.CreateConverter(Converters.CsvTypeCode.String, true)); wrapper.AddProperty(prop1); wrapper.ReplacePropertyAt(0, null !); }