예제 #1
0
        public void Cannot_Combine_Last_And_After()
        {
            ArgumentException argEx = null;

            try
            {
                GenerateConnection(5, last: 1, after: Cursor(1));
            }
            catch (ArgumentException ex)
            {
                argEx = ex;
            }
            argEx.ShouldNotBeNull();
            argEx?.Message.ShouldEqual("Cannot use `last` in conjunction with `after`.");
        }
예제 #2
0
        public void Cannot_Combine_First_And_Before()
        {
            ArgumentException argEx = null;

            try
            {
                GenerateConnection(5, first: 1, before: Cursor(3));
            }
            catch (ArgumentException ex)
            {
                argEx = ex;
            }
            argEx.ShouldNotBeNull();
            argEx?.Message.ShouldEqual("Cannot use `first` in conjunction with `before`.");
        }
예제 #3
0
        public void CombineFirstAndLast()
        {
            ArgumentException argEx = null;

            try
            {
                GenerateConnection(5, first: 1, last: 1);
            }
            catch (ArgumentException ex)
            {
                argEx = ex;
            }
            argEx.ShouldNotBeNull();
            argEx?.Message.ShouldEqual("Cannot use `first` in conjunction with `last`.");
        }
예제 #4
0
        public void CombineBeforeAndAfter()
        {
            ArgumentException argEx = null;

            try
            {
                GenerateConnection(5, before: Cursor(1), after: Cursor(1));
            }
            catch (ArgumentException ex)
            {
                argEx = ex;
            }
            argEx.ShouldNotBeNull();
            argEx?.Message.ShouldEqual("Cannot use `after` in conjunction with `before`.");
        }
예제 #5
0
            public void ThrowsArgumentException_WhenArg_IsLessThanOne()
            {
                ArgumentException exception = null;

                try
                {
                    var obj = new GenerateRandomSecretQuery(0);
                    obj.ShouldBeNull();
                }
                catch (ArgumentException ex)
                {
                    exception = ex;
                }

                exception.ShouldNotBeNull();
                // ReSharper disable PossibleNullReferenceException
                exception.ParamName.ShouldEqual("minimumLength");
                // ReSharper restore PossibleNullReferenceException
            }
 public void argument_exception_thrown()
 {
     _result.ShouldNotBeNull();
 }
 public void then_it_throws_an_exception()
 {
     _result.ShouldNotBeNull();
 }