예제 #1
0
        public void NewRecordExpectedAddANewRecordToRecordset()
        {
            var rs = new Recordset {
                Name = "MyRec"
            };

            rs.Records.Add(rs.NewRecord());
            Assert.AreEqual(1, rs.Records.Count);
            Assert.AreEqual("MyRec(1)", rs.Records[0].Label);
        }
예제 #2
0
        public void SetValueExpectedAddANewRecordToRecordset()
        {
            var rs = new Recordset {
                Name = "MyRec"
            };

            rs.Records.Add(rs.NewRecord());
            rs.Fields.Add(new RecordsetField {
                Name = "MyField", Alias = "MyField"
            });
            rs.SetValue(0, 0, "MyTestData");
            Assert.AreEqual("MyTestData", rs.Records[0][0].Value);
        }
예제 #3
0
        public void SetValueSecondMethodExpectedAddANewRecordToRecordset()
        {
            var rs = new Recordset {
                Name = "MyRec"
            };
            var rsr = rs.NewRecord();

            rs.Records.Add(rsr);
            rs.Fields.Add(new RecordsetField {
                Name = "MyField", Alias = "MyField"
            });
            rs.Fields.Add(new RecordsetField {
                Name = "MyField2", Alias = "MyField2"
            });
            rs.SetValue(ref rsr, 0, "MyTestData");
            Assert.AreEqual("MyTestData", rs.Records[0][0].Value);
            rs.SetValue(ref rsr, 1, "MyTestData1");
            rs.SetValue(ref rsr, 0, "MyTestData3");
            Assert.AreEqual("MyTestData1", rs.Records[0][1].Value);
            Assert.AreEqual("MyTestData3", rs.Records[0][0].Value);
        }