Browse Source

Wrote some tests + fixed select all bug

flabbet 5 years ago
parent
commit
d152c9acb8

+ 11 - 6
PixiEditor/Models/Controllers/BitmapManager.cs

@@ -135,12 +135,7 @@ namespace PixiEditor.Models.Controllers
             if (Mouse.LeftButton == MouseButtonState.Pressed && !IsDraggingViewport()
                                                              && MouseController.ClickedOnCanvas && ActiveDocument != null)
             {
-                if (IsOperationTool(SelectedTool))
-                    BitmapOperations.ExecuteTool(e.NewPosition,
-                        MouseController.LastMouseMoveCoordinates.ToList(), (BitmapOperationTool) SelectedTool);
-                else
-                    ReadonlyToolUtility.ExecuteTool(MouseController.LastMouseMoveCoordinates.ToArray(),
-                        (ReadonlyTool) SelectedTool);
+                ExecuteTool(e.NewPosition);   
             }
             else if (Mouse.LeftButton == MouseButtonState.Released)
             {
@@ -148,6 +143,16 @@ namespace PixiEditor.Models.Controllers
             }
         }
 
+        public void ExecuteTool(Coordinates newPosition)
+        {
+            if (IsOperationTool(SelectedTool))
+                BitmapOperations.ExecuteTool(newPosition,
+                    MouseController.LastMouseMoveCoordinates.ToList(), (BitmapOperationTool)SelectedTool);
+            else
+                ReadonlyToolUtility.ExecuteTool(MouseController.LastMouseMoveCoordinates.ToArray(),
+                    (ReadonlyTool)SelectedTool);
+        }
+
         private bool IsDraggingViewport()
         {
             return Keyboard.IsKeyDown(Key.LeftShift);

+ 1 - 1
PixiEditor/Models/IO/Exporter.cs

@@ -18,7 +18,7 @@ namespace PixiEditor.Models.IO
         /// </summary>
         /// <param name="document">Document to save</param>
         /// <param name="updateWorkspacePath">Should editor remember dialog path for further saves</param>
-        public static void SaveAsNewEditableFile(Document document, bool updateWorkspacePath = false)
+        public static void SaveAsEditableFileWithDialog(Document document, bool updateWorkspacePath = false)
         {
             SaveFileDialog dialog = new SaveFileDialog
             {

+ 1 - 1
PixiEditor/Models/Tools/Tools/RectangleTool.cs

@@ -57,7 +57,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public Coordinates[] CreateRectangle(Coordinates start, Coordinates end, int thickness)
         {
-            return CreateRectangle(new[] {start, end}, thickness);
+            return CreateRectangle(new[] {end, start}, thickness);
         }
 
         private Coordinates[] CalculateRectanglePoints(DoubleCords coordinates)

+ 6 - 6
PixiEditor/Models/Tools/Tools/SelectTool.cs

@@ -48,7 +48,7 @@ namespace PixiEditor.Models.Tools.Tools
         private void Select(Coordinates[] pixels)
         {
             Coordinates[] selection = GetRectangleSelectionForPoints(pixels[^1], pixels[0]);
-            ViewModelMain.Current.ActiveSelection.SetSelection(selection.ToArray(), SelectionType);
+            ViewModelMain.Current.ActiveSelection.SetSelection(selection, SelectionType);
         }
 
         public Coordinates[] GetRectangleSelectionForPoints(Coordinates start, Coordinates end)
@@ -65,17 +65,17 @@ namespace PixiEditor.Models.Tools.Tools
         /// <returns>Coordinates array of pixels</returns>
         public Coordinates[] GetAllSelection()
         {
-            return GetAllSelection(ViewModelMain.Current.BitmapManager.ActiveDocument.Layers[0]);
+            return GetAllSelection(ViewModelMain.Current.BitmapManager.ActiveDocument);
         }
 
         /// <summary>
-        ///     Gets coordinates of every pixel in choosen layer
+        ///     Gets coordinates of every pixel in chosen document
         /// </summary>
-        /// <param name="layer"></param>
+        /// <param name="document"></param>
         /// <returns>Coordinates array of pixels</returns>
-        public Coordinates[] GetAllSelection(Layer layer)
+        public Coordinates[] GetAllSelection(Document document)
         {
-            return GetRectangleSelectionForPoints(new Coordinates(0, 0), new Coordinates(layer.Width, layer.Height));
+            return GetRectangleSelectionForPoints(new Coordinates(0, 0), new Coordinates(document.Width - 1, document.Height - 1));
         }
     }
 }

+ 5 - 5
PixiEditor/ViewModels/ViewModelMain.cs

@@ -257,6 +257,7 @@ namespace PixiEditor.ViewModels
             UndoManager.SetMainRoot(this);
             SetActiveTool(ToolType.Move);
             BitmapManager.PrimaryColor = PrimaryColor;
+            ActiveSelection = new Selection(Array.Empty<Coordinates>());
             Current = this;
         }
 
@@ -343,7 +344,7 @@ namespace PixiEditor.ViewModels
         {
             bool paramIsAsNew = parameter != null && parameter.ToString()?.ToLower() == "asnew";
             if (paramIsAsNew || Exporter.SaveDocumentPath == null)
-                Exporter.SaveAsNewEditableFile(BitmapManager.ActiveDocument, !paramIsAsNew);
+                Exporter.SaveAsEditableFileWithDialog(BitmapManager.ActiveDocument, !paramIsAsNew);
             else
                 Exporter.SaveAsEditableFile(BitmapManager.ActiveDocument, Exporter.SaveDocumentPath);
             _unsavedDocumentModified = false;
@@ -433,7 +434,7 @@ namespace PixiEditor.ViewModels
         public void SelectAll(object parameter)
         {
             SelectTool select = new SelectTool();
-            select.Use(select.GetAllSelection());
+            ActiveSelection.SetSelection(select.GetAllSelection(), SelectionType.New);
         }
 
         private bool CanSelectAll(object property)
@@ -441,7 +442,7 @@ namespace PixiEditor.ViewModels
             return BitmapManager.ActiveDocument != null && BitmapManager.ActiveDocument.Layers.Count > 0;
         }
 
-        private bool DocumentIsNotNull(object property)
+        public bool DocumentIsNotNull(object property)
         {
             return BitmapManager.ActiveDocument != null;
         }
@@ -453,8 +454,7 @@ namespace PixiEditor.ViewModels
 
         private bool SelectionIsNotEmpty(object property)
         {
-            return ActiveSelection != null && ActiveSelection.SelectedPoints != null &&
-                   ActiveSelection.SelectedPoints.Count > 0;
+            return ActiveSelection?.SelectedPoints != null && ActiveSelection.SelectedPoints.Count > 0;
         }
 
         public void SetTool(object parameter)

+ 1 - 1
PixiEditor/Views/ImportFilePopup.xaml

@@ -42,7 +42,7 @@
                 <StackPanel Background="{StaticResource MainColor}" Height="120" Width="225" Margin="0,30,0,0">
                     <local:SizePicker EditingEnabled="{Binding PathIsCorrect}"
                                       ChosenWidth="{Binding ImportWidth, Mode=TwoWay}"
-                                      ChoosenHeight="{Binding ImportHeight,Mode=TwoWay}" />
+                                      ChosenHeight="{Binding ImportHeight,Mode=TwoWay}" />
                 </StackPanel>
             </StackPanel>
             <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right"

+ 1 - 1
PixiEditor/Views/NewFilePopup.xaml

@@ -38,7 +38,7 @@
             <StackPanel HorizontalAlignment="Center" Margin="0,60,0,0" Background="{StaticResource MainColor}"
                         VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
                 <local:SizePicker Margin="0,20" HorizontalAlignment="Center" Height="110"
-                                  ChoosenHeight="{Binding FileHeight,Mode=TwoWay, ElementName=newFilePopup}"
+                                  ChosenHeight="{Binding FileHeight,Mode=TwoWay, ElementName=newFilePopup}"
                                   ChosenWidth="{Binding FileWidth,Mode=TwoWay, ElementName=newFilePopup}" />
             </StackPanel>
             <Button VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="20" Height="30" Width="60"

+ 1 - 1
PixiEditor/Views/ResizeCanvasPopup.xaml

@@ -41,7 +41,7 @@
         <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="{StaticResource MainColor}"
                     VerticalAlignment="Top" Grid.Row="1" Width="300" Height="250">
             <local:SizePicker Margin="0,10,0,0" Width="300" Height="110"
-                              ChoosenHeight="{Binding NewHeight, Mode=TwoWay, ElementName=window}"
+                              ChosenHeight="{Binding NewHeight, Mode=TwoWay, ElementName=window}"
                               ChosenWidth="{Binding NewWidth, Mode=TwoWay, ElementName=window}" />
             <Separator Margin="10,20,10,0" Background="{StaticResource AccentColor}" Height="1" />
             <Label Content="Anchor point:" Foreground="White" Margin="10,5,0,0" HorizontalAlignment="Left"

+ 1 - 1
PixiEditor/Views/ResizeDocumentPopup.xaml

@@ -39,7 +39,7 @@
                Content="Resize document" />
         <StackPanel HorizontalAlignment="Center" Margin="0,50,0,0" Background="{StaticResource MainColor}"
                     VerticalAlignment="Top" Grid.Row="1" Width="350" Height="150">
-            <local:SizePicker Margin="0,20" ChoosenHeight="{Binding Path=NewHeight, Mode=TwoWay, ElementName=window}"
+            <local:SizePicker Margin="0,20" ChosenHeight="{Binding Path=NewHeight, Mode=TwoWay, ElementName=window}"
                               ChosenWidth="{Binding Path=NewWidth, Mode=TwoWay, ElementName=window}" />
         </StackPanel>
         <Button Grid.Row="1" Height="30" Width="60" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10"

+ 1 - 1
PixiEditor/Views/SaveFilePopup.xaml

@@ -34,7 +34,7 @@
                        Text="File settings" TextAlignment="Center" Margin="0,10,0,0" FontSize="24" />
             <StackPanel Orientation="Vertical" Grid.Row="1" Margin="0,50,0,0">
                 <local:SizePicker Width="250" Height="120"
-                                  ChoosenHeight="{Binding Path=SaveHeight, Mode=TwoWay, ElementName=saveFilePopup}"
+                                  ChosenHeight="{Binding Path=SaveHeight, Mode=TwoWay, ElementName=saveFilePopup}"
                                   ChosenWidth="{Binding Path=SaveWidth, Mode=TwoWay, ElementName=saveFilePopup}" />
                 <Button Foreground="Snow" Height="40" Width="160" Margin="0,10,0,0" Content="Path"
                         Background="{StaticResource MainColor}" BorderBrush="{Binding PathButtonBorder}"

+ 10 - 10
PixiEditor/Views/SizePicker.xaml

@@ -7,24 +7,24 @@
              mc:Ignorable="d"
              d:DesignHeight="110" d:DesignWidth="215" Name="uc">
     <StackPanel Background="{StaticResource MainColor}">
-        <DockPanel Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
-            <TextBlock Height="30" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16"
-                       HorizontalAlignment="Center" VerticalAlignment="Center" />
-            <local:SizeInput IsEnabled="{Binding EditingEnabled, ElementName=uc}" Margin="5,0,0,0"
-                             PreserveAspectRatio="{Binding Path=IsChecked, ElementName=aspectRatio}"
-                             AspectRatioValue="{Binding Path=ChosenWidth, ElementName=uc}"
-                             HorizontalAlignment="Left" Width="150" Height="30"
-                             Size="{Binding ChoosenHeight, ElementName=uc, Mode=TwoWay}" />
-        </DockPanel>
         <DockPanel Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
             <TextBlock Height="30" Foreground="Snow" Text="Width:" TextAlignment="Center" FontSize="16"
                        HorizontalAlignment="Center" VerticalAlignment="Center" />
             <local:SizeInput IsEnabled="{Binding EditingEnabled, ElementName=uc}" Width="150" Height="30"
                              PreserveAspectRatio="{Binding Path=IsChecked, ElementName=aspectRatio}"
-                             AspectRatioValue="{Binding Path=ChoosenHeight, ElementName=uc}"
+                             AspectRatioValue="{Binding Path=ChosenHeight, ElementName=uc}"
                              HorizontalAlignment="Left" Margin="10,0,0,0"
                              Size="{Binding Path=ChosenWidth, ElementName=uc, Mode=TwoWay}" />
         </DockPanel>
+        <DockPanel Margin="5,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Center">
+            <TextBlock Height="30" Foreground="Snow" Text="Height:" TextAlignment="Center" FontSize="16"
+                       HorizontalAlignment="Center" VerticalAlignment="Center" />
+            <local:SizeInput IsEnabled="{Binding EditingEnabled, ElementName=uc}" Margin="5,0,0,0"
+                             PreserveAspectRatio="{Binding Path=IsChecked, ElementName=aspectRatio}"
+                             AspectRatioValue="{Binding Path=ChosenWidth, ElementName=uc}"
+                             HorizontalAlignment="Left" Width="150" Height="30"
+                             Size="{Binding ChosenHeight, ElementName=uc, Mode=TwoWay}" />
+        </DockPanel>
         <CheckBox Name="aspectRatio" Content="Preserve aspect ratio" Foreground="White" HorizontalAlignment="Left"
                   IsChecked="True" Margin="50,10,0,0" />
     </StackPanel>

+ 6 - 6
PixiEditor/Views/SizePicker.xaml.cs

@@ -16,9 +16,9 @@ namespace PixiEditor.Views
         public static readonly DependencyProperty ChosenWidthProperty =
             DependencyProperty.Register("ChosenWidth", typeof(int), typeof(SizePicker), new PropertyMetadata(1));
 
-        // Using a DependencyProperty as the backing store for ChoosenHeight.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty ChoosenHeightProperty =
-            DependencyProperty.Register("ChoosenHeight", typeof(int), typeof(SizePicker), new PropertyMetadata(1));
+        // Using a DependencyProperty as the backing store for ChosenHeight.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ChosenHeightProperty =
+            DependencyProperty.Register("ChosenHeight", typeof(int), typeof(SizePicker), new PropertyMetadata(1));
 
         public SizePicker()
         {
@@ -40,10 +40,10 @@ namespace PixiEditor.Views
         }
 
 
-        public int ChoosenHeight
+        public int ChosenHeight
         {
-            get => (int) GetValue(ChoosenHeightProperty);
-            set => SetValue(ChoosenHeightProperty, value);
+            get => (int) GetValue(ChosenHeightProperty);
+            set => SetValue(ChosenHeightProperty, value);
         }
     }
 }

+ 12 - 0
PixiEditorTests/ApplicationCollection.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Xunit;
+
+namespace PixiEditorTests
+{
+    [CollectionDefinition("Application collection")]
+    public class ApplicationCollection : ICollectionFixture<ApplicationFixture>
+    {
+    }
+}

+ 22 - 0
PixiEditorTests/ApplicationFixture.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Text;
+using System.Windows;
+using PixiEditor;
+
+namespace PixiEditorTests
+{
+    [ExcludeFromCodeCoverage]
+    public class ApplicationFixture
+    {
+        public ApplicationFixture()
+        {
+            if (Application.Current == null)
+            {
+                var app = new App();
+                app.InitializeComponent();
+            }
+        }
+    }
+}

+ 22 - 1
PixiEditorTests/ModelsTests/ControllersTests/BitmapManagerTests.cs

@@ -76,6 +76,27 @@ namespace PixiEditorTests.ModelsTests.ControllersTests
             Assert.True(BitmapManager.IsOperationTool(singlePixelPen));
         }
 
+        [StaFact]
+        public void TestThatBitmapChangesExecuteToolExecutesPenTool()
+        {
+            BitmapManager bitmapManager = new BitmapManager
+            {
+                ActiveDocument = new Document(5, 5)
+            };
+
+            bitmapManager.AddNewLayer("Layer");
+            bitmapManager.SetActiveTool(new MockedSinglePixelPen());
+            bitmapManager.PrimaryColor = Colors.Green;
+
+            bitmapManager.MouseController.StartRecordingMouseMovementChanges(true);
+            bitmapManager.MouseController.RecordMouseMovementChange(new Coordinates(1, 1));
+            bitmapManager.MouseController.StopRecordingMouseMovementChanges();
+
+            bitmapManager.ExecuteTool(new Coordinates(1, 1));
+
+            Assert.Equal(Colors.Green, bitmapManager.ActiveLayer.GetPixelWithOffset(1, 1));
+        }
+
     }
 
     public class MockedSinglePixelPen : BitmapOperationTool
@@ -83,7 +104,7 @@ namespace PixiEditorTests.ModelsTests.ControllersTests
         public override LayerChange[] Use(Layer layer, Coordinates[] mouseMove, Color color)
         {
             return Only(
-                BitmapPixelChanges.FromSingleColoredArray(new[] {new Coordinates(0, 0)}, Colors.Black),0);
+                BitmapPixelChanges.FromSingleColoredArray(new[] {mouseMove[0]}, color),0);
         }
 
         public override ToolType ToolType { get; } = ToolType.Pen;

+ 23 - 0
PixiEditorTests/ModelsTests/IO/ExporterTests.cs

@@ -2,8 +2,12 @@
 using System.Collections.Generic;
 using System.IO;
 using System.Text;
+using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.IO;
+using PixiEditor.Models.Layers;
+using PixiEditor.Models.Position;
 using Xunit;
 
 namespace PixiEditorTests.ModelsTests.IO
@@ -20,5 +24,24 @@ namespace PixiEditorTests.ModelsTests.IO
 
             File.Delete(FilePath);
         }
+
+        [Fact]
+        public void TestThatSaveAsEditableFileSavesPixiFile()
+        {
+            Document document = new Document(2,2);
+
+            string filePath = "testFile.pixi";
+
+            document.Layers.Add(new Layer("layer1"));
+            document.Layers[0].SetPixel(new Coordinates(1,1), Colors.White);
+
+            document.Swatches.Add(Colors.White);
+
+            Exporter.SaveAsEditableFile(document, filePath);
+
+            Assert.True(File.Exists(filePath));
+
+            File.Delete(filePath);
+        }
     }
 }

+ 1 - 12
PixiEditorTests/ModelsTests/ToolsTests/BrightnessToolTests.cs

@@ -11,20 +11,9 @@ using Xunit;
 
 namespace PixiEditorTests.ModelsTests.ToolsTests
 {
+    [Collection("Application collection")]
     public class BrightnessToolTests
     {
-
-        public BrightnessToolTests()
-        {
-            if (Application.Current == null)
-            {
-                var app = new App();
-
-                app.InitializeComponent();
-            }
-
-        }
-
         [StaTheory]
         [InlineData(5, 12, 12, 12)]
         [InlineData(-5, 242, 242, 242)]

+ 45 - 0
PixiEditorTests/ModelsTests/ToolsTests/RectangleToolTests.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Text;
+using System.Windows;
+using PixiEditor;
+using PixiEditor.Models.Position;
+using PixiEditor.Models.Tools.Tools;
+using Xunit;
+
+namespace PixiEditorTests.ModelsTests.ToolsTests
+{
+    public class RectangleToolTests
+    {
+        private bool _createdApp = false;
+
+        [ExcludeFromCodeCoverage]
+        public RectangleToolTests()
+        {
+            if (Application.Current == null && _createdApp == false)
+            {
+                var app = new App();
+                app.InitializeComponent();
+            }
+        }
+
+        [StaTheory]
+        [InlineData(0,0, 2,2)]
+        [InlineData(0,0, 9, 9)]
+        [InlineData(5,5, 6, 6)]
+        [InlineData(0,0, 15, 15)]
+        public void TestThatCreateRectangleCalculatesCorrectOutlineWithOneThickness(int startX, int startY, int endX, int endY)
+        {
+            RectangleTool tool = new RectangleTool();
+
+            var outline = tool.CreateRectangle(new Coordinates(startX, startY),
+                new Coordinates(endX, endY), 1);
+
+            int expectedBorderPoints = (endX - startX) * 2 + (endY - startX) * 2;
+
+            Assert.Equal(expectedBorderPoints, outline.Length);
+        }
+
+    }
+}

+ 67 - 11
PixiEditorTests/ViewModelsTests/ViewModelMainTests.cs

@@ -1,28 +1,23 @@
-using System.Windows;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Windows;
 using System.Windows.Input;
 using System.Windows.Media;
 using PixiEditor;
 using PixiEditor.Models.Controllers;
 using PixiEditor.Models.DataHolders;
+using PixiEditor.Models.IO;
 using PixiEditor.Models.Position;
 using PixiEditor.Models.Tools;
+using PixiEditor.Models.Tools.Tools;
 using PixiEditor.ViewModels;
 using Xunit;
 
 namespace PixiEditorTests.ViewModelsTests
 {
+    [Collection("Application collection")]
     public class ViewModelMainTests
     {
-
-        public ViewModelMainTests()
-        {
-            if (Application.Current == null)
-            {
-                var app = new App();
-                app.InitializeComponent();
-            }
-        }
-
         [StaFact]
         public void TestThatConstructorSetsUpControllersCorrectly()
         {
@@ -116,5 +111,66 @@ namespace PixiEditorTests.ViewModelsTests
             Assert.Single(viewModel.BitmapManager.ActiveDocument.Layers);
         }
 
+        [StaFact]
+        public void TestThatSaveDocumentCommandSavesFile()
+        {
+            ViewModelMain viewModel = new ViewModelMain();
+            string fileName = "testFile.pixi";
+
+            viewModel.BitmapManager.ActiveDocument = new Document(1,1);
+
+            Exporter.SaveDocumentPath = fileName;
+
+            viewModel.SaveDocumentCommand.Execute(null);
+
+            Assert.True(File.Exists(fileName));
+
+            File.Delete(fileName);
+        }
+
+        [StaFact]
+        public void TestThatAddSwatchAddsNonDuplicateSwatch()
+        {
+            ViewModelMain viewModel = new ViewModelMain();
+            viewModel.BitmapManager.ActiveDocument = new Document(1,1);
+
+            viewModel.AddSwatch(Colors.Green);
+            viewModel.AddSwatch(Colors.Green);
+
+            Assert.Single(viewModel.BitmapManager.ActiveDocument.Swatches);
+            Assert.Equal(Colors.Green,viewModel.BitmapManager.ActiveDocument.Swatches[0]);
+        }
+
+        [StaTheory]
+        [InlineData(5,7)]
+        [InlineData(1,1)]
+        [InlineData(1,2)]
+        [InlineData(2,1)]
+        [InlineData(16,16)]
+        [InlineData(50,28)]
+        [InlineData(120,150)]
+        public void TestThatSelectAllCommandSelectsWholeDocument(int docWidth, int docHeight)
+        {
+            ViewModelMain viewModel = new ViewModelMain
+            {
+                BitmapManager = {ActiveDocument = new Document(docWidth, docHeight)}
+            };
+            viewModel.BitmapManager.AddNewLayer("layer");
+            
+            viewModel.SelectAllCommand.Execute(null);
+
+            Assert.Equal(viewModel.BitmapManager.ActiveDocument.Width * viewModel.BitmapManager.ActiveDocument.Height,
+                viewModel.ActiveSelection.SelectedPoints.Count);
+        }
+
+        [StaFact]
+        public void TestThatDocumentIsNotNullReturnsTrue()
+        {
+            ViewModelMain viewModel = new ViewModelMain();
+
+            viewModel.BitmapManager.ActiveDocument = new Document(1,1);
+
+            Assert.True(viewModel.DocumentIsNotNull(null));
+        }
     }
 }