Exemplo n.º 1
0
        public void IBusinessObjectEnumerationProperty_GetValueInfoByIdentifier_WithFalse()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty("Scalar");

            CheckEnumerationValueInfo(
                new BooleanEnumerationValueInfo(false, (IBusinessObjectBooleanProperty)property),
                property.GetValueInfoByIdentifier("False", null));
        }
Exemplo n.º 2
0
        public void ValidEnumValue()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithValueType <TestEnum>), "Scalar");

            CheckEnumerationValueInfo(
                new EnumerationValueInfo(TestEnum.Value1, "Value1", "Value1", true),
                property.GetValueInfoByIdentifier("Value1", null));
        }
Exemplo n.º 3
0
        public void GetDisplayNameFromGlobalizationSerivce()
        {
            var mockEnumerationGlobalizationService     = _mockRepository.StrictMock <IEnumerationGlobalizationService>();
            IBusinessObjectEnumerationProperty property = CreateProperty(
                typeof(ClassWithValueType <TestEnum>),
                "Scalar",
                new BindableObjectGlobalizationService(
                    MockRepository.GenerateStub <IGlobalizationService>(),
                    MockRepository.GenerateStub <IMemberInformationGlobalizationService>(),
                    mockEnumerationGlobalizationService,
                    MockRepository.GenerateStub <IExtensibleEnumGlobalizationService>()));

            Expect.Call(
                mockEnumerationGlobalizationService.TryGetEnumerationValueDisplayName(Arg.Is(TestEnum.Value1), out Arg <string> .Out("MockValue1").Dummy))
            .Return(true);
            _mockRepository.ReplayAll();

            IEnumerationValueInfo actual = property.GetValueInfoByIdentifier("Value1", null);

            _mockRepository.VerifyAll();
            CheckEnumerationValueInfo(new EnumerationValueInfo(TestEnum.Value1, "Value1", "MockValue1", true), actual);
        }
Exemplo n.º 4
0
        public void IBusinessObjectEnumerationProperty_GetValueInfoByIdentifier_WithEmptyString()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty("Scalar");

            Assert.That(property.GetValueInfoByIdentifier(string.Empty, null), Is.Null);
        }
Exemplo n.º 5
0
        public void InvalidIdentifier()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithValueType <TestEnum>), "Scalar");

            property.GetValueInfoByIdentifier("Invalid", null);
        }
Exemplo n.º 6
0
        public void UndefinedEnumValue()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithValueType <EnumWithUndefinedValue>), "Scalar");

            Assert.That(property.GetValueInfoByIdentifier("UndefinedValue", null), Is.Null);
        }
Exemplo n.º 7
0
        public void Empty()
        {
            IBusinessObjectEnumerationProperty property = CreateProperty(typeof(ClassWithValueType <TestEnum>), "Scalar");

            Assert.That(property.GetValueInfoByIdentifier(string.Empty, null), Is.Null);
        }