Пример #1
0
        private void UpdateStandardLabel(object sender, RoutedEventArgs e)
        {
            string standardLabel = MetadataLoader.ComposeStandardLabel(
                MetaDataSystemName.Text, MetadataStartDate.SelectedDate, MetadataEndDate.SelectedDate
                );

            ((CreatePackageViewModel)DataContext).MetaDataNoarkSection.StandardLabel = standardLabel;
        }
Пример #2
0
        public void ComposeStandardLabelTest()
        {
            // All parts provided
            MetadataLoader.ComposeStandardLabel(_metadata.System.Name, _metadata.StartDate, _metadata.EndDate)
            .Should().Be("Some system name (1970 - 2000)");

            // System name missing
            MetadataLoader.ComposeStandardLabel(null, _metadata.StartDate, _metadata.EndDate)
            .Should().Be("(1970 - 2000)");

            // Start-date missing
            MetadataLoader.ComposeStandardLabel(_metadata.System.Name, null, _metadata.EndDate)
            .Should().Be("Some system name");

            // End-date missing
            MetadataLoader.ComposeStandardLabel(_metadata.System.Name, _metadata.StartDate, null)
            .Should().Be("Some system name");

            // No parts provided
            MetadataLoader.ComposeStandardLabel(null, null, null)
            .Should().Be("");
        }