示例#1
0
        public void AddColumn()
        {
            AmplaRecord record = new AmplaRecord(100);

            record.AddColumn("Field", typeof(int));
            Assert.That(record.GetValue("Field"), Is.Null);
        }
示例#2
0
 public ModelVersions(AmplaRecord amplaRecord)
 {
     Id       = amplaRecord.Id;
     Location = amplaRecord.Location;
     Module   = amplaRecord.Module;
     Versions = new List <ModelVersion>();
 }
示例#3
0
        public void AddColumnDifferentType()
        {
            AmplaRecord record = new AmplaRecord(100);

            record.AddColumn("Field", typeof(string));

            Assert.Throws <ArgumentException>(() => record.AddColumn("Field", typeof(int)));
        }
示例#4
0
        public void GetValue_Location()
        {
            AmplaRecord record = new AmplaRecord(100)
            {
                Location = "Plant.Area.Point"
            };

            Assert.That(record.GetValue("Location"), Is.EqualTo("Plant.Area.Point"));
        }
示例#5
0
        public void Id()
        {
            AmplaRecord record = new AmplaRecord(100);

            Assert.That(record.Id, Is.EqualTo(100));

            record.Id = 200;

            Assert.That(record.Id, Is.EqualTo(200));
        }
示例#6
0
        public void LocationGetValueRetrievesLocationField()
        {
            AmplaRecord record = new AmplaRecord(100)
            {
                Location = "Plant.Area.Point"
            };

            Assert.That(record.GetValue("Location"), Is.EqualTo("Plant.Area.Point"));
            Assert.That(record.Location, Is.EqualTo("Plant.Area.Point"));
        }
示例#7
0
        public void AddColumnSameType()
        {
            AmplaRecord record = new AmplaRecord(100);

            record.AddColumn("Location", typeof(string));
            record.AddColumn("Location", typeof(string));

            Assert.That(record.GetFieldNames().Length, Is.EqualTo(1));
            Assert.That(record.GetFieldNames()[0], Is.EqualTo("Location"));

            Assert.That(record.GetValue("Location"), Is.Null);
        }
示例#8
0
        public void LocationPropertyIsSetViaSetValue()
        {
            AmplaRecord record = new AmplaRecord(100);

            Assert.That(record.Location, Is.Null);
            record.AddColumn("Location", typeof(string));

            Assert.That(record.Location, Is.Null);

            record.SetValue("Location", "Plant.Area.Point");
            Assert.That(record.Location, Is.EqualTo("Plant.Area.Point"));
        }
示例#9
0
        public void Location()
        {
            AmplaRecord record = new AmplaRecord(100);

            Assert.That(record.Location, Is.Null);

            record.Location = "Plant.Area.Point";

            Assert.That(record.Location, Is.EqualTo("Plant.Area.Point"));

            record.SetValue("Location", "Plant.Area.Equipment.Point");
        }
示例#10
0
        public void GetFieldNames_NoFields()
        {
            AmplaRecord record = new AmplaRecord(100);

            Assert.That(record.GetFieldNames(), Is.Not.Empty);

            Assert.That(record.GetValue("Location"), Is.Null);

            Assert.That(record.Location, Is.Null);

            record.SetValue("Location", "Plant.Area.Point");
            Assert.That(record.Location, Is.EqualTo("Plant.Area.Point"));
        }