コード例 #1
0
        public void SetFieldTest()
        {
            var entity = new EntityMember();

            entity.SetField(fieldId: 555, value: "value");

            var result = entity.Fields.Find(x => x.Id == 555).Values[0].Value;

            Assert.AreEqual(result, "value");
        }
コード例 #2
0
        public void SetFieldAndTypeTest()
        {
            var entity = new EntityMember();

            entity.SetField(fieldId: 555, value: "value", 888);

            var value = entity.Fields.Find(x => x.Id == 555).Values[0].Value;
            var @enum = entity.Fields.Find(x => x.Id == 555).Values[0].Enum;

            Assert.AreEqual(value, "value");
            Assert.AreEqual(@enum, 888);
        }
コード例 #3
0
        public void SetAndGetFieldAndTypeTest()
        {
            var entity = new EntityMember();

            entity.SetField(fieldId: 555, value: "value", 888);

            var result = entity.GetField(555);

            Assert.IsInstanceOfType(result, typeof(Field));
            Assert.AreEqual(result.Id, 555);
            Assert.AreEqual(result.Values.Count, 1);
            Assert.AreEqual(result.Values[0].Enum, 888);
            Assert.AreEqual(result.Values[0].Value, "value");
        }