Source

stacky / trunk / source / Tests / Stacky.IntegrationTests / AnswerTests.cs

Diff from to

trunk/source/Tests/Stacky.IntegrationTests/AnswerTests.cs

 using System.Collections.Generic;
 using System.Linq;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Linq.Expressions;
 
 namespace Stacky.IntegrationTests
 {
     public class AnswerTests : IntegrationTest
     {
         [TestMethod]
+        public void Answer_GetAnswers_NoParams()
+        {
+            var answers = Client.GetAnswers();
+            Assert.IsNotNull(answers);
+        }
+
+        protected T? Enum<T>()
+            where T : struct
+        {
+            return GenerateValue.NullableEnum<T>();
+        }
+
+        protected SortDirection? SortDirection
+        {
+            get { return GenerateValue.NullableEnum<SortDirection>(); }
+        }
+
+        protected int? Page
+        {
+            get
+            {
+                return GenerateValue.NullableInt32(1, 250);
+            }
+        }
+
+        protected int? PageSize
+        {
+            get
+            {
+                return GenerateValue.NullableInt32(1, 250);
+            }
+        }
+
+        protected DateTime? FromDate
+        {
+            get { return GenerateValue.NullableDateTime(); }
+        }
+
+        protected DateTime? ToDate
+        {
+            get { return GenerateValue.NullableDateTime(); }
+        }
+
+        protected DateTime? DateMin
+        {
+            get { return GenerateValue.NullableDateTime(); }
+        }
+
+        protected DateTime? DateMax
+        {
+            get { return GenerateValue.NullableDateTime(); }
+        }
+
+        protected string Filter
+        {
+            get { return null; }
+        }
+
+        [TestMethod]
+        public void Answer_GetAnswers_RandomParams()
+        {
+            var answers = Client.GetAnswers(Enum<AnswerSort>(), SortDirection, Page, PageSize, FromDate, ToDate, DateMin, DateMax, Filter);
+            Assert.IsNotNull(answers);
+        }
+
+        [TestMethod]
         public void Answer_GetQuestionAnswers()
         {
             var answers = Client.GetQuestionAnswers(31415);
             Assert.IsNotNull(answers);
         }
 
-        [TestMethod]
-        public void Answer_GetAnswers_NoParams()
-        {
-            var answers = Client.GetAnswers();
-            Assert.IsNotNull(answers);
-        }
+        
     }
 }