Exemplo n.º 1
0
 /// <summary>
 /// Initialize view model.
 /// </summary>
 private void InitializeViewmodel()
 {
     TileGeneratorViewModel viewModel = new TileGeneratorViewModel();
     viewModel.Close += new System.EventHandler(OnClose);
     viewModel.StartOverClickedEvent += new System.EventHandler(OnStartOverClickedEvent);
     this.DataContext = viewModel;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize view model.
        /// </summary>
        private void InitializeViewmodel()
        {
            TileGeneratorViewModel viewModel = new TileGeneratorViewModel();

            viewModel.Close += new System.EventHandler(OnClose);
            viewModel.StartOverClickedEvent += new System.EventHandler(OnStartOverClickedEvent);
            this.DataContext = viewModel;
        }
Exemplo n.º 3
0
 public void IsCloseEnabledTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsCloseVisible = expected;
         actual = target.IsCloseVisible;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 4
0
 public void IsCancelEnabledLayerDetailsViewModel()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsCancelVisible = expected;
         actual = target.IsCancelVisible;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 5
0
 public void CreditsURLLayerDetailsViewModel()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         Uri expected = new Uri("https://google.com");
         Uri actual;
         target.CreditsURL = expected;
         actual            = target.CreditsURL;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 6
0
 public void CreditsTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "2 credits";
         string actual;
         target.Credits = expected;
         actual         = target.Credits;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 7
0
 public void InputImageDetailsTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         InputImageDetailsViewModel expected = new InputImageDetailsViewModel();
         InputImageDetailsViewModel actual;
         target.InputImageDetails = expected;
         actual = target.InputImageDetails;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 8
0
 public void IsCompletedPanelVisibleTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = false;
         bool actual;
         target.IsCompletedPanelVisible = expected;
         actual = target.IsCompletedPanelVisible;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 9
0
 public void IsCreateImageScreenVisibleTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsCreateImageScreenVisible = expected;
         actual = target.IsCreateImageScreenVisible;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 10
0
 public void OutputFileNameTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "Image";
         string actual;
         target.OutputFileName = expected;
         actual = target.OutputFileName;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 11
0
 public void InvalidOutputFileNameErrorMessageTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "error message";
         string actual;
         target.InvalidOutputFileNameErrorMessage = expected;
         actual = target.InvalidOutputFileNameErrorMessage;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 12
0
 public void OutputFolderPathTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = Environment.CurrentDirectory + @"\Image\L0X0Y0.Png";
         string actual;
         target.OutputFolderPath = expected;
         actual = target.OutputFolderPath;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 13
0
 public void IsOutputProjectionEnabledTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsOutputProjectionEnabled = expected;
         actual = target.IsOutputProjectionEnabled;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 14
0
 public void IsInputDetailsScreenVisibleTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = false;
         bool actual;
         target.IsInputDetailsScreenVisible = expected;
         actual = target.IsInputDetailsScreenVisible;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 15
0
 public void IsGeneratePlateTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsGeneratePlate = expected;
         actual = target.IsGeneratePlate;
         Assert.AreEqual(expected, actual);
     }
 }
Exemplo n.º 16
0
 public void LevelsLayerTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         ObservableCollection <string> expected = new ObservableCollection <string>();
         expected.Add("0");
         expected.Add("1");
         ObservableCollection <string> actual;
         target.Levels = expected;
         actual        = target.Levels;
         Assert.AreEqual(expected.Count, actual.Count);
         foreach (string level in expected)
         {
             Assert.IsTrue(actual.Contains(level));
         }
     }
 }
Exemplo n.º 17
0
 public void OutputProjectionTypesTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         ProjectionTypes[] expected = (ProjectionTypes[])Enum.GetValues(typeof(ProjectionTypes));
         foreach (ProjectionTypes projectionType in expected)
         {
             target.OutputProjectionTypes.Add(projectionType);
         }
         ObservableCollection <ProjectionTypes> actual;
         actual = target.OutputProjectionTypes;
         foreach (ProjectionTypes projectionType in expected)
         {
             Assert.IsTrue(actual.Contains(projectionType));
         }
     }
 }
Exemplo n.º 18
0
        /// <summary>
        /// Initializes a new instance of the ImagePyramidDetails class.
        /// </summary>
        public ImagePyramidDetails(TileGeneratorViewModel viewModel)
        {
            if (viewModel != null)
            {
                this.InputImagePath = viewModel.InputImageDetails.InputImagePath;
                this.InputProjection = viewModel.InputImageDetails.SelectedInputProjectionType;
                this.OutputFilename = viewModel.OutputFileName;
                this.OutputProjection = viewModel.SelectedOutputProjectionType;
                this.OutputDirectory = viewModel.UpdatedOutputFolderPath;
                this.IsGeneratePlate = viewModel.IsGeneratePlate;
                this.Level = int.Parse(viewModel.SelectedLevel, CultureInfo.InvariantCulture);
                this.Credits = viewModel.Credits;
                this.CreditsURL = viewModel.CreditsURL == null ? string.Empty : viewModel.CreditsURL.ToString();

                this.InputBoundary = new Core.Boundary(
                    double.Parse(viewModel.InputImageDetails.TopLeftLongitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.BottomRightLatitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.BottomRightLongitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.TopLeftLatitude, CultureInfo.InvariantCulture));
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Initializes a new instance of the ImagePyramidDetails class.
        /// </summary>
        public ImagePyramidDetails(TileGeneratorViewModel viewModel)
        {
            if (viewModel != null)
            {
                this.InputImagePath   = viewModel.InputImageDetails.InputImagePath;
                this.InputProjection  = viewModel.InputImageDetails.SelectedInputProjectionType;
                this.OutputFilename   = viewModel.OutputFileName;
                this.OutputProjection = viewModel.SelectedOutputProjectionType;
                this.OutputDirectory  = viewModel.UpdatedOutputFolderPath;
                this.IsGeneratePlate  = viewModel.IsGeneratePlate;
                this.Level            = int.Parse(viewModel.SelectedLevel, CultureInfo.InvariantCulture);
                this.Credits          = viewModel.Credits;
                this.CreditsURL       = viewModel.CreditsURL == null ? string.Empty : viewModel.CreditsURL.ToString();

                this.InputBoundary = new Core.Boundary(
                    double.Parse(viewModel.InputImageDetails.TopLeftLongitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.BottomRightLatitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.BottomRightLongitude, CultureInfo.InvariantCulture),
                    double.Parse(viewModel.InputImageDetails.TopLeftLatitude, CultureInfo.InvariantCulture));
            }
        }
 public void OutputProjectionTypesTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         ProjectionTypes[] expected = (ProjectionTypes[])Enum.GetValues(typeof(ProjectionTypes));
         foreach (ProjectionTypes projectionType in expected)
         {
             target.OutputProjectionTypes.Add(projectionType);
         }
         ObservableCollection<ProjectionTypes> actual;
         actual = target.OutputProjectionTypes;
         foreach (ProjectionTypes projectionType in expected)
         {
             Assert.IsTrue(actual.Contains(projectionType));
         }
     }
 }
 public void CreditsURLLayerDetailsViewModel()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         Uri expected = new Uri("https://google.com");
         Uri actual;
         target.CreditsURL = expected;
         actual = target.CreditsURL;
         Assert.AreEqual(expected, actual);
     }
 }
 public void CreditsTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "2 credits";
         string actual;
         target.Credits = expected;
         actual = target.Credits;
         Assert.AreEqual(expected, actual);
     }
 }
 public void InvalidOutputPathErrorMessageTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "error message";
         string actual;
         target.InvalidOutputPathErrorMessage = expected;
         actual = target.InvalidOutputPathErrorMessage;
         Assert.AreEqual(expected, actual);
     }
 }
 public void InputImageDetailsTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         InputImageDetailsViewModel expected = new InputImageDetailsViewModel();
         InputImageDetailsViewModel actual;
         target.InputImageDetails = expected;
         actual = target.InputImageDetails;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsCompletedPanelVisibleTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = false;
         bool actual;
         target.IsCompletedPanelVisible = expected;
         actual = target.IsCompletedPanelVisible;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsCancelEnabledLayerDetailsViewModel()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsCancelVisible = expected;
         actual = target.IsCancelVisible;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsOutputDetailsScreenVisibleTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsOutputDetailsScreenVisible = expected;
         actual = target.IsOutputDetailsScreenVisible;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsGeneratePlateTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsGeneratePlate = expected;
         actual = target.IsGeneratePlate;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsOutputProjectionEnabledTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsOutputProjectionEnabled = expected;
         actual = target.IsOutputProjectionEnabled;
         Assert.AreEqual(expected, actual);
     }
 }
 public void IsStartOverEnabledTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         bool expected = true;
         bool actual;
         target.IsStartOverVisible = expected;
         actual = target.IsStartOverVisible;
         Assert.AreEqual(expected, actual);
     }
 }
 public void LevelsLayerTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         ObservableCollection<string> expected = new ObservableCollection<string>();
         expected.Add("0");
         expected.Add("1");
         ObservableCollection<string> actual;
         target.Levels = expected;
         actual = target.Levels;
         Assert.AreEqual(expected.Count, actual.Count);
         foreach (string level in expected)
         {
             Assert.IsTrue(actual.Contains(level));
         }
     }
 }
 public void OutputFileNameTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = "Image";
         string actual;
         target.OutputFileName = expected;
         actual = target.OutputFileName;
         Assert.AreEqual(expected, actual);
     }
 }
 public void OutputFolderPathTest()
 {
     using (TileGeneratorViewModel target = new TileGeneratorViewModel())
     {
         string expected = Environment.CurrentDirectory + @"\Image\L0X0Y0.Png";
         string actual;
         target.OutputFolderPath = expected;
         actual = target.OutputFolderPath;
         Assert.AreEqual(expected, actual);
     }
 }