Browse Source

Cleaned tests suite

Marcin Ziąbek 4 years ago
parent
commit
9fddea84ba

+ 0 - 6
QuestPDF.UnitTests/AlignmentTests.cs

@@ -9,12 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class AlignmentTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Alignment().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new Alignment().DrawWithoutChild();
-
         [Test]
         public void Draw_HorizontalCenter_VerticalCenter()
         {

+ 0 - 6
QuestPDF.UnitTests/AspectRatioTests.cs

@@ -9,12 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class AspectRatioTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new AspectRatio().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new AspectRatio().DrawWithoutChild();
-        
         [Test]
         public void Measure_FitWidth_EnoughSpace_FullRender()
         {

+ 0 - 3
QuestPDF.UnitTests/BackgroundTests.cs

@@ -9,9 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class BackgroundTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Background().MeasureWithoutChild();
-
         [Test]
         public void Draw_ShouldHandleNullChild()
         {

+ 0 - 3
QuestPDF.UnitTests/BorderTests.cs

@@ -10,9 +10,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class BorderTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Border().MeasureWithoutChild();
-
         [Test]
         public void ComponentShouldNotAffectLayout()
         {

+ 0 - 6
QuestPDF.UnitTests/ConstrainedTests.cs

@@ -9,12 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class ConstrainedTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Constrained().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new Constrained().DrawWithoutChild();
-
         [Test]
         public void Measure_MinHeight_ExpectWrap()
         {

+ 0 - 10
QuestPDF.UnitTests/DebugTests.cs

@@ -1,10 +0,0 @@
-using NUnit.Framework;
-
-namespace QuestPDF.UnitTests
-{
-    [TestFixture]
-    public class DebugTests
-    {
-        
-    }
-}

+ 0 - 6
QuestPDF.UnitTests/ExtendTests.cs

@@ -9,12 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class ExtendTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Extend().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new Extend().DrawWithoutChild();
-        
         [Test]
         public void Measure_ReturnsWrap_WhenChildReturnsWrap()
         {

+ 0 - 30
QuestPDF.UnitTests/Helpers.cs

@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using FluentAssertions;
-using QuestPDF.Infrastructure;
-using QuestPDF.UnitTests.TestEngine;
-
-namespace QuestPDF.UnitTests
-{
-    public static class Helpers
-    {
-        public static Random Random = new Random();
-        
-        public static Size RandomSize => new Size(Random.Next(200, 400), Random.Next(100, 200));
-
-        public static void ShouldEqual(this IEnumerable<OperationBase> commands, IEnumerable<OperationBase> expected)
-        {
-            commands.Should().HaveSameCount(expected);
-            
-            commands
-                .Zip(expected)
-                .ToList()
-                .ForEach(x =>
-                {
-                    x.First.Should().BeOfType(x.Second.GetType());
-                    x.First.Should().BeEquivalentTo(x.Second, y => y.RespectingRuntimeTypes());
-                });
-        }
-    }
-}

+ 0 - 6
QuestPDF.UnitTests/ImageTests.cs

@@ -11,12 +11,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class ImageTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new AspectRatio().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new AspectRatio().DrawWithoutChild();
-        
         [Test]
         public void Measure_TakesAvailableSpaceRegardlessOfSize()
         {

+ 0 - 6
QuestPDF.UnitTests/PaddingTests.cs

@@ -9,12 +9,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class PaddingTests
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new Padding().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new Padding().DrawWithoutChild();
-        
         private Padding GetPadding(TestPlan plan)
         {
             return new Padding()

+ 0 - 10
QuestPDF.UnitTests/PageNumberTests.cs

@@ -1,10 +0,0 @@
-using NUnit.Framework;
-
-namespace QuestPDF.UnitTests
-{
-    [TestFixture]
-    public class PageNumberTests
-    {
-
-    }
-}

+ 0 - 6
QuestPDF.UnitTests/ShowOnceTest.cs

@@ -10,12 +10,6 @@ namespace QuestPDF.UnitTests
     [TestFixture]
     public class ShowOnceTest
     {
-        [Test]
-        public void Measure_ShouldHandleNullChild() => new ShowOnce().MeasureWithoutChild();
-        
-        [Test]
-        public void Draw_ShouldHandleNullChild() => new ShowOnce().DrawWithoutChild();
-
         [Test]
         public void ShouldRenderOnce_WhenRenderingCalledMultipleTimes()
         {

+ 0 - 31
QuestPDF.UnitTests/TestEngine/SingleChildTests.cs

@@ -1,31 +0,0 @@
-using FluentAssertions;
-using NUnit.Framework;
-using QuestPDF.Drawing.SpacePlan;
-using QuestPDF.Infrastructure;
-
-namespace QuestPDF.UnitTests.TestEngine
-{
-    public static class SingleChildTests
-    {
-        internal static void MeasureWithoutChild<T>(this T element) where T : ContainerElement
-        {
-            element.Child = null;
-            element.Measure(Size.Zero).Should().BeEquivalentTo(new FullRender(Size.Zero));
-        }
-        
-        internal static void DrawWithoutChild<T>(this T element) where T : ContainerElement
-        {
-            // component does not throw an exception when called with null child
-            Assert.DoesNotThrow(() =>
-            {
-                element.Child = null;
-                
-                // component does not perform any canvas operation when called with null child
-                TestPlan
-                    .For(x => element)
-                    .DrawElement(new Size(200, 100))
-                    .CheckDrawResult();
-            });
-        }
-    }
-}

+ 0 - 10
QuestPDF.UnitTests/TextTests.cs

@@ -1,10 +0,0 @@
-using NUnit.Framework;
-
-namespace QuestPDF.UnitTests
-{
-    [TestFixture]
-    public class TextTests
-    {
-        
-    }
-}