コード例 #1
0
        public void Does_not_throw_an_exception_when_the_table_is_empty_and_the_set_is_empty()
        {
            var table = new Table("StringProperty");

            var items = new SetComparisonTestObject[] {};

            var comparisonResult = DetermineIfExceptionWasThrownByComparingThese(table, items);

            comparisonResult.ExceptionWasThrown.ShouldBeFalse(comparisonResult.ExceptionMessage);
        }
コード例 #2
0
        public void Throws_an_exception_when_there_is_one_row_but_the_set_is_empty()
        {
            var table = new Table("StringProperty");
            table.AddRow("this is not an empty table");

            var items = new SetComparisonTestObject[] {};

            var comparisonResult = DetermineIfExceptionWasThrownByComparingThese(table, items);

            comparisonResult.ExceptionWasThrown.ShouldBeTrue(comparisonResult.ExceptionMessage);
        }
コード例 #3
0
ファイル: ProjectionTests.cs プロジェクト: BEllis/SpecFlow
        public void SetUp()
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

            testInstance = new SetComparisonTestObject
                        {
                            DateTimeProperty = DateTime.Today,
                            GuidProperty = testGuid1,
                            IntProperty = 1,
                            StringProperty = "a"
                        };
            testCollection = new[]
                {
                    testInstance,
                    new SetComparisonTestObject
                        {
                            DateTimeProperty = DateTime.Today, 
                            GuidProperty = testGuid2, 
                            IntProperty = 2, 
                            StringProperty = "b"
                        },
                };
        }
コード例 #4
0
 private static ComparisonException GetTheExceptionThrowByComparingThese(Table table, SetComparisonTestObject[] items)
 {
     try
     {
         table.CompareToSet(items);
     }
     catch (ComparisonException ex)
     {
         return ex;
     }
     return null;
 }
コード例 #5
0
 private static ComparisonTestResult DetermineIfExceptionWasThrownByComparingThese(Table table, SetComparisonTestObject[] items)
 {
     var result = new ComparisonTestResult { ExceptionWasThrown = false };
     try
     {
         table.CompareToSet(items);
     }
     catch (ComparisonException ex)
     {
         result.ExceptionWasThrown = true;
         result.ExceptionMessage = ex.Message;
     }
     return result;
 }