/// <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; }
public void IsCloseEnabledTest() { using (TileGeneratorViewModel target = new TileGeneratorViewModel()) { bool expected = true; bool actual; target.IsCloseVisible = expected; actual = target.IsCloseVisible; 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 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 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 IsCreateImageScreenVisibleTest() { using (TileGeneratorViewModel target = new TileGeneratorViewModel()) { bool expected = true; bool actual; target.IsCreateImageScreenVisible = expected; actual = target.IsCreateImageScreenVisible; Assert.AreEqual(expected, actual); } }
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 InvalidOutputFileNameErrorMessageTest() { using (TileGeneratorViewModel target = new TileGeneratorViewModel()) { string expected = "error message"; string actual; target.InvalidOutputFileNameErrorMessage = expected; actual = target.InvalidOutputFileNameErrorMessage; 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); } }
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 IsInputDetailsScreenVisibleTest() { using (TileGeneratorViewModel target = new TileGeneratorViewModel()) { bool expected = false; bool actual; target.IsInputDetailsScreenVisible = expected; actual = target.IsInputDetailsScreenVisible; 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 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 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)); } } }
/// <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 InvalidOutputPathErrorMessageTest() { using (TileGeneratorViewModel target = new TileGeneratorViewModel()) { string expected = "error message"; string actual; target.InvalidOutputPathErrorMessage = expected; actual = target.InvalidOutputPathErrorMessage; 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 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)); } } }