public async Task MultilineStringFieldTest()
        {
            AggContext.StaticData = new FileSystemStaticData(TestContext.CurrentContext.ResolveProjectPath(4, "StaticData"));
            MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4));

            var theme = new ThemeConfig();

            theme.RebuildTheme(ActiveTheme.Instance);

            await ValidateAgainstValueMap <MultilineStringField>(
                (field) => (field.Content as MHTextEditWidget).ActualTextEditWidget.Text,
                new List <ValueMap>()
            {
                { "0.12345", "0.12345" },
                { "1.2345", "1.2345" },
                { "12.345", "12.345" },
                { "12.7", "12.7" },
                { "+0.12345", "+0.12345" },
                { "+1.2345", "+1.2345" },
                { "+12.345", "+12.345" },
                { "-0.12345", "-0.12345" },
                { "-1.2345", "-1.2345" },
                { "-12.345", "-12.345" },
                { "12.7", "12.7" },
                { "22", "22" },
                { "abc", "abc" },
                { "+abc", "+abc" },
                { "-abc", "-abc" },
                { "-abc\nline2", "-abc\nline2" },
            });
        }
Beispiel #2
0
        public async Task MultilineStringFieldTest()
        {
            var theme = new ThemeConfig();

            theme.RebuildTheme();

            var testField = new MultilineStringField(theme);

            await ValidateAgainstValueMap(
                testField,
                (field) => (field.Content as MHTextEditWidget).ActualTextEditWidget.Text,
                new List <ValueMap>()
            {
                { "0.12345", "0.12345" },
                { "1.2345", "1.2345" },
                { "12.345", "12.345" },
                { "12.7", "12.7" },
                { "+0.12345", "+0.12345" },
                { "+1.2345", "+1.2345" },
                { "+12.345", "+12.345" },
                { "-0.12345", "-0.12345" },
                { "-1.2345", "-1.2345" },
                { "-12.345", "-12.345" },
                { "12.7", "12.7" },
                { "22", "22" },
                { "abc", "abc" },
                { "+abc", "+abc" },
                { "-abc", "-abc" },
                { "-abc\nline2", "-abc\nline2" },
            });
        }
Beispiel #3
0
        public async Task ComPortFieldTest()
        {
            FrostedSerialPort.MockPortsForTest = true;
            AggContext.StaticData = new FileSystemStaticData(TestContext.CurrentContext.ResolveProjectPath(4, "StaticData"));
            MatterControlUtilities.OverrideAppDataLocation(TestContext.CurrentContext.ResolveProjectPath(4));

            var theme = new ThemeConfig();

            theme.RebuildTheme(ActiveTheme.Instance);

            var field = new ComPortField(new PrinterConfig(PrinterSettings.Empty), theme);

            await ValidateAgainstValueMap(
                field,
                (f) => (f.Content.Children <DropDownList>().FirstOrDefault() as DropDownList).SelectedLabel,
                new List <ValueMap>()
            {
                { "COM-TestA", "COM-TestA" },
                { "COM-TestB", "COM-TestB" },
                { "COM-TestC", "COM-TestC" },
                { "COM-Test0", "COM-Test0" },
                { "COM-Test1", "COM-Test1" },
            });
        }