public void CannotCreateWithInvalidFolder() {
            var act = new Action(() => new RegistryInfo("some path", null));
            var act2 = new Action(() => new RegistryInfo("some path", ""));

            act.ShouldThrow<ArgumentNullException>();
            act2.ShouldNotThrow();
        }
        public void CanAlterDatabase(SqlConnection connection, Action action)
        {
            "Given a SQL Server connection"
                .f(c => connection = new SqlConnection(this.ConnectionString).Using(c));

            "When I initialize that connection for this test"
                .f(() => action = () => connection.InitializeSchema("features", "CanAlterDatabase"));

            "Then that action should succeed"
                .f(() => action.ShouldNotThrow());
        }
		public void AsValidEntityUrl_ValidUrl_DoesNotThrows ()
		{
			// arrange
			var url = "aaa";


			// act
			var action = new Action (() => url.AsValidEntityUrl ("url"));


			// assert
			action.ShouldNotThrow ();
		}
        private IQueryContainer AndAssignManyBoolQueries(QueryContainer q)
        {
            var container = new QueryContainer();

            System.Action act = () =>
            {
                for (var i = 0; i < Iterations; i++)
                {
                    container &= q;
                }
            };
            act.ShouldNotThrow();
            return(container);
        }
Example #5
0
        public void NullQueryDoesNotCauseANullReferenceException()
        {
            System.Action query = () => this.Client.Search <Project>(s => s
                                                                     .Query(q => q
                                                                            .Bool(b => b
                                                                                  .Filter(f => f
                                                                                          .Term(t => t.Name, null)
                                                                                          )
                                                                                  )
                                                                            )
                                                                     );

            query.ShouldNotThrow();
        }
        public void NullQueryDoesNotCauseANullReferenceException()
        {
            System.Action query = () => this.Client.Search <Project>(s => s
                                                                     .Query(q => q
                                                                            .DisMax(dm => dm
                                                                                    .Queries(
                                                                                        dmq => dmq.Term(t => t.Name, null)
                                                                                        )
                                                                                    )
                                                                            )
                                                                     );

            query.ShouldNotThrow();
        }
        private IQueryContainer OrAssignManyBoolQueries(QueryContainer q)
        {
            var container = new QueryContainer();

            System.Action act = () =>
            {
                for (int i = 0; i < Iterations; i++)
                {
                    container |= q;
                }
            };
            act.ShouldNotThrow();
            LotsOfOrs(container);
            return(container);
        }
Example #8
0
        public async Task UndefinekeyCommandHandlerExecuteUnregistersAKeySequence()
        {
            var keySequences = new[] { "A", "Control+T", "Control+Shift+Alt+T" };
            var undefinekeyCommandHandler = new UndefinekeyCommandHandler(this.keyMapService);
            var keymap = this.keyMapService.GetKeyMapByName(TestKeyMap);
            foreach (var keySequence in keySequences)
            {
                var undefinekeyCommand = new UndefinekeyCommand { Args = TestKeyMap + " " + keySequence };
                (await undefinekeyCommandHandler.Execute(undefinekeyCommand)).Should().BeTrue();

                var registerKey = new Action(
                    () =>
                        {
                            keymap.RegisterAction((Keys)new KeysConverter().ConvertFrom(keySequence), args => Task.Run(() => true));
                        });
                registerKey.ShouldNotThrow();
            }
        }
		public void AsValidEntityUrl_Null_DoesNotThrows ()
		{
			// arrange
			string url = null;


			// act
			// ReSharper disable once ExpressionIsAlwaysNull
			var action = new Action (() => url.AsValidEntityUrl ("url"));


			// assert
			action.ShouldNotThrow ();
		}
		public void AsValidEmail_ValidEmail_DoesNotThrows ()
		{
			// arrange
			var email = "a@a";


			// act
			var action = new Action (() => email.AsValidEmail ("email"));


			// assert
			action.ShouldNotThrow ();
		}
 public void CreatingAResultShouldNotThrowWithValidGuids()
 {
     var action = new Action(() => { var result = new Result(Guid.NewGuid(), Guid.NewGuid()); });
     action.ShouldNotThrow();
 }
 protected override void ShouldPass()
 {
     var action = new Action(() => { });
     action.ShouldNotThrow();
 }
 public void ShouldPass()
 {
     var action = new Action(() => { });
     action.ShouldNotThrow();
 }
Example #14
0
 protected override void ShouldThrowAWobbly()
 {
     var action = new Action(() => { throw new InvalidOperationException(); });
     action.ShouldNotThrow("Some additional context");
 }