Пример #1
0
        public void TestRoundtripTypeWithEnum([ValueSource(nameof(Int32EnumValues))] Int32Enum value)
        {
            var obj = new TypeWithEnum
            {
                Value = value
            };
            var actualObj = Roundtrip(obj);

            actualObj.Should().NotBeNull();
            actualObj.Value.Should().Be(value);
        }
Пример #2
0
		public void CanGetEnumValue()
		{
			using (var con = OpenDbConnection())
			{
				con.CreateTable<TypeWithEnum>(true);
				var obj = new TypeWithEnum {Id = 1, EnumValue = SomeEnum.Value1};
				con.Save(obj);
				var target = con.GetById<TypeWithEnum>(obj.Id);
				Assert.AreEqual(obj.Id, target.Id);
				Assert.AreEqual(obj.EnumValue, target.EnumValue);
			}
		}
Пример #3
0
        public override void SetUp()
        {
            base.SetUp();
            _bocEnumValue    = new BocEnumValueMock();
            _bocEnumValue.ID = "BocEnumValue";
            NamingContainer.Controls.Add(_bocEnumValue);

            _businessObject = TypeWithEnum.Create();

            _propertyEnumValue =
                (IBusinessObjectEnumerationProperty)((IBusinessObject)_businessObject).BusinessObjectClass.GetPropertyDefinition("EnumValue");

            _dataSource = new StubDataSource(((IBusinessObject)_businessObject).BusinessObjectClass);
            _dataSource.BusinessObject = (IBusinessObject)_businessObject;
        }