Example #1
0
        public void Not_Accept_Empty_Options()
        {
            var sut = new NZazuKeyedOptionsField(new FieldDefinition {
                Key = "test"
            }, ServiceLocator);

            1.Invoking(i => { sut.Options = new string[] { }; }).Should().Throw <ArgumentException>();
        }
Example #2
0
        public void Be_Creatable()
        {
            var sut = new NZazuKeyedOptionsField(new FieldDefinition {
                Key = "test"
            }, ServiceLocator);

            sut.Should().NotBeNull();
            sut.Should().BeAssignableTo <INZazuWpfField>();
        }
Example #3
0
        public void Create_ComboBox()
        {
            var definition = new FieldDefinition {
                Key = "test", Description = "description"
            };
            var sut = new NZazuKeyedOptionsField(definition, ServiceLocator);

            sut.ContentProperty.Should().Be(ComboBox.TextProperty);
            var control = (ComboBox)sut.ValueControl;

            control.Should().NotBeNull();

            control.ToolTip.Should().Be(sut.Definition.Description);
        }
Example #4
0
        public void Add_Values_To_List()
        {
            // TODO FIX ME
            var definition = new FieldDefinition {
                Key = "test", Description = "description", Prompt = "prompt"
            };
            var sut = new NZazuKeyedOptionsField(definition, ServiceLocator);

            var control = (ComboBox)sut.ValueControl;

            control.Text = "Foo";
            sut.LabelControl.SetFocus();

            control.Text.Should().Be("Foo");
        }
Example #5
0
        public void Identify_Value_with_StringValue()
        {
            var sut = new NZazuKeyedOptionsField(new FieldDefinition {
                Key = "test", Description = "description"
            },
                                                 ServiceLocator);

            sut.Value.Should().BeNull();
            sut.GetValue().Should().Be(sut.Value);

            sut.SetValue("1");
            sut.Value.Should().Be(sut.GetValue());

            sut.Value = "2";
            sut.GetValue().Should().Be(sut.Value);
        }