public void ChangeFrameworkSelectionToXna()
        {
            var viewModel = CreateViewModel();

            viewModel.OnFrameworkSelectionChanged.Execute(3);
            WpfApprovals.Verify(() => CreateVerifiableWindowFromViewModel(viewModel));
        }
예제 #2
0
 public void InitialView()
 {
     WpfApprovals.Verify(
         () => new Window {
         Content = new SampleItemView(), Width = 800, Height = 600
     });
 }
예제 #3
0
        public void ConstructorTest()
        {
            var timeController = CreateTimeControllerParts(() => touDate).Item1;
            var mainWindow     = BuildMainWindow(timeController, new ItemRing <string>());

            WpfApprovals.Verify(mainWindow);
        }
        public void ChangePath()
        {
            var viewModel = CreateViewModel();

            viewModel.OnLocationChanged.Execute("C:\\DeltaEngine\\");
            WpfApprovals.Verify(() => CreateVerifiableWindowFromViewModel(viewModel));
        }
        public void ChangeName()
        {
            var viewModel = CreateViewModel();

            viewModel.OnNameChanged.Execute("ChangedProjectName");
            WpfApprovals.Verify(() => CreateVerifiableWindowFromViewModel(viewModel));
        }
예제 #6
0
 public void LoginGuiTest()
 {
     WpfApprovals.Verify(WindowGenerator.GenerateWindow(new LoginViewModel(this.contextSwitcher.Object, new List <string>()
     {
         "user1", "user2", "user3"
     }), "DartTraining"));
 }
        public void CannotCreateWithInvalidProjectName()
        {
            var viewModel = CreateViewModel();

            viewModel.OnNameChanged.Execute("name");
            viewModel.OnCreateClicked.Execute(null);
            WpfApprovals.Verify(() => CreateVerifiableWindowFromViewModel(viewModel));
        }
예제 #8
0
 public void TestWindowFunc()
 {
     WpfApprovals.Verify(() => new Window {
         Content = new Button {
             Content = "Hello from Lambdas"
         }, Width = 200, Height = 200
     });
 }
        public void CannotCreateWithInvalidProjectLocation()
        {
            var viewModel = CreateViewModel();

            viewModel.OnLocationChanged.Execute("Delta Engine");
            viewModel.OnCreateClicked.Execute(null);
            WpfApprovals.Verify(() => CreateVerifiableWindowFromViewModel(viewModel));
        }
 public void TestContextMenu()
 {
     var menu = new ContextMenu();
     menu.Items.Add(new MenuItem {Header = "Add Element"});
     menu.Items.Add(new MenuItem {Header = "Delete"});
     menu.Items.Add(new MenuItem {Header = "Edit"});
     menu.IsOpen = true;
     WpfApprovals.Verify(menu);
 }
예제 #11
0
        public void CheckGuiWhenFilledValues()
        {
            var window    = new MainWindow();
            var viewModel = window.DataContext as MainViewModel;

            viewModel.Sigma = 20;
            viewModel.My    = 50;
            WpfApprovals.Verify(window);
        }
예제 #12
0
 public void SearchUnknownContainer()
 {
     WpfApprovals.Verify(() =>
     {
         var window        = new MainWindow();
         window.SearchText = "MEDU9000123";
         window.DoSearch();
         return(window);
     });
 }
예제 #13
0
 public void SearchContainerWithNoShips()
 {
     WpfApprovals.Verify(() =>
     {
         var window        = new MainWindow();
         window.SearchText = "TRLU5539435";
         window.DoSearch();
         return(window);
     });
 }
예제 #14
0
 public void SearchContainerWithFullInfo()
 {
     WpfApprovals.Verify(() =>
     {
         var window        = new MainWindow();
         window.SearchText = "MEDU7485729";
         window.DoSearch();
         return(window);
     });
 }
예제 #15
0
        public void TestFormApproval()
        {
            var button = new Button {
                Content = "Hello"
            };
            var window = new Window {
                Content = button, Width = 200, Height = 200
            };

            WpfApprovals.Verify(window);
        }
예제 #16
0
        public void ProgressTimerTest()
        {
            var timeControllerParts = CreateTimeControllerParts(() => touDate);
            var timeController      = timeControllerParts.Item1;

            var mainWindow = BuildMainWindow(timeController, new ItemRing <string>());

            mainWindow.ResetTimer();

            timeControllerParts.Item2[0](timeController, null);
            WpfApprovals.Verify(mainWindow);
        }
예제 #17
0
        public void DrawTest()
        {
            var canvas = new Canvas {
                Width = 200, Height = 200
            };

            var collective = new BlobCollective(1.0, 1.0, 4);

            collective.Draw(canvas, 100.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #18
0
        public void ProgressTimerToNewTimeTest()
        {
            var dateTimes = GetInitialDateTimes();

            dateTimes.Enqueue(touDate.AddMinutes(2));

            var timeControllerParts = CreateTimeControllerParts(dateTimes.Dequeue);
            var timeController      = timeControllerParts.Item1;

            var mainWindow = BuildMainWindow(timeController, new ItemRing <string>());

            mainWindow.ResetTimer();
            timeControllerParts.Item2[0](timeController, null);

            WpfApprovals.Verify(mainWindow);
        }
예제 #19
0
        public void DrawTest()
        {
            var panel = new Canvas {
                Width = 100, Height = 100
            };

            var pointMass = new PointMass(11.0, 13.0, 11.0);

            pointMass.Draw(panel, 2.0);

            var wpf = new ContentControl {
                Content = panel
            };

            WpfApprovals.Verify(wpf);
        }
예제 #20
0
        public void DrawTest()
        {
            var canvas = new Canvas {
                Width = 200, Height = 200
            };

            var blob = new Blob(13.0, 17.0, 11.0, 5);

            blob.Draw(canvas, 5.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #21
0
        public void DrawSimpleBodyTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var blob = new Blob(50.0, 50.0, 25.0, 5);

            blob.DrawSimpleBody(canvas, 1.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #22
0
        public void DrawTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var massA = new PointMass(13.0, 17.0, 5.0);
            var massB = new PointMass(43.0, 41.0, 7.0);
            var stick = new Skin(massA, massB);


            stick.Draw(canvas, 2.0);
            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #23
0
        public void SplitTest()
        {
            var canvas = new Canvas {
                Width = 200, Height = 200
            };

            var collective = new BlobCollective(1.0, 1.0, 4);

            collective.Split();
            Assert.AreEqual(2, collective.NumActive);
            collective.Draw(canvas, 100.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #24
0
        public void MoveToTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var blob = new Blob(41.0, 43.0, 23.0, 5);

            blob.MoveTo(61.0, 59.0);
            blob.DrawSimpleBody(canvas, 1.0);

            DrawDot(canvas, Brushes.Blue, 2.0, blob.X, blob.Y);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #25
0
        public void TestListDisplayUpdatesWhenListUpdates()
        {
            var dateTimes = GetInitialDateTimes();

            dateTimes.Enqueue(touDate.AddMinutes(2));

            var timeControllerParts = CreateTimeControllerParts(dateTimes.Dequeue);
            var timeController      = timeControllerParts.Item1;

            var itemRing = new ItemRing <string>()
            {
                "One", "Two", "Three"
            };
            var mainWindow = BuildMainWindow(timeController, itemRing);

            itemRing.RemoveAt(1);
            timeControllerParts.Item2[0](timeController, null);

            WpfApprovals.Verify(mainWindow);
        }
예제 #26
0
        public void CtorSticksTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var blob   = new Blob(41.0, 43.0, 23.0, 5);
            var sticks = blob.Skins;

            foreach (var skin in sticks)
            {
                skin.Draw(canvas, 1.0);
            }

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #27
0
        public void CtorPointMassesTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var blob        = new Blob(41.0, 43.0, 23.0, 5);
            var pointMasses = blob.Points;

            foreach (var pointMass in pointMasses)
            {
                DrawDot(canvas, Brushes.Black, pointMass.Mass, pointMass.XPos, pointMass.YPos);
            }

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #28
0
        public void AddBlobTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var blob1 = new Blob(17.0, 19.0, 11.0, 5);
            var blob2 = new Blob(59.0, 61.0, 13.0, 5);

            blob1.LinkBlob(blob2);

            DrawDot(canvas, Brushes.Blue, blob1.Mass, blob1.X, blob1.Y);

            blob2.DrawSimpleBody(canvas, 1.0);

            foreach (var bone in blob1.Bones)
            {
                var pointMassA = bone.PointMassA;
                var pointMassB = bone.PointMassB;
                DrawDot(canvas, Brushes.Red, 2.0, pointMassA.XPos, pointMassA.YPos);
                DrawLine(canvas, Brushes.Black,
                         pointMassA.XPos, pointMassA.YPos,
                         pointMassB.XPos, pointMassB.YPos);
            }

            foreach (var neighbor in blob1.Neighbors)
            {
                var pointMassA = neighbor.PointMassA;
                var pointMassB = neighbor.PointMassB;
                DrawDot(canvas, Brushes.Red, 2.0, pointMassA.XPos, pointMassA.YPos);
                DrawLine(canvas, Brushes.Black,
                         pointMassA.XPos, pointMassA.YPos,
                         pointMassB.XPos, pointMassB.YPos);
            }

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #29
0
        public void DrawFaceTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var translateTransform = new TranslateTransform(50.0, 50.0);
            var transformGroup     = new TransformGroup();

            transformGroup.Children.Add(translateTransform);

            var blob = new Blob(50.0, 50.0, 25.0, 5);

            blob.DrawFace(canvas, 3.0, transformGroup);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }
예제 #30
0
        public void ScTest()
        {
            var canvas = new Canvas {
                Width = 100, Height = 100
            };

            var environment = new Environment(0.0, 0.0, 100.0, 100.0);
            var blob        = new Blob(71.0, 67.0, 23.0, 5)
            {
                Force = new Vector(3.0, 3.0)
            };

            blob.Move(3.0);
            blob.Sc(environment);
            blob.DrawSimpleBody(canvas, 1.0);

            var wpf = new ContentControl {
                Content = canvas
            };

            WpfApprovals.Verify(wpf);
        }