public void TestNotLessThanFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(1, IsNot.LessThan(2));
     });
 }
 public void TestInequalityFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That("A", IsNot.EqualTo("A"));
     });
 }
 public void TestNotGreaterThanFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(2, IsNot.GreaterThan(1));
     });
 }
 public void TestIsNotEmptyStringFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(string.Empty, IsNot.EmptyString());
     });
 }
 public void TestNotContainsStringFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That("string", IsNot.MatchFor("str"));
     });
 }
 public void TestsCanBeChained()
 {
     XAssert
     .That("string", IsNot.EmptyString())
     .And(Is.MatchFor("ing"))
     .And(Is.MatchFor("str"));
 }
 public void TestIsNotTrueFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(true, IsNot.True());
     });
 }
 public void TestNotErroringWithFalse()
 {
     XAssert.That(() =>
     {
         var a = 1;
     }, IsNot.ErroringWith <System.IO.DirectoryNotFoundException>());
 }
 public void TestNotErroringWithTrue()
 {
     XAssert.That(() =>
     {
         var a = 1;
     }, IsNot.ErroringWith <XAssertionFailedException>());
 }
Beispiel #10
0
 public void TestNotNullFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(null, IsNot.Null());
     });
 }
Beispiel #11
0
 public void TestIsNotFalseFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert.That(false, IsNot.False());
     });
 }
Beispiel #12
0
        public void TestNotContainsItemTrue()
        {
            var test = new List <string> {
                "test2"
            };

            XAssert.That(test, IsNot.Storing("test"));
        }
Beispiel #13
0
 public void TestNotContainsRegexFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         var re = new Regex("str");
         XAssert.That("string", IsNot.MatchFor(re));
     });
 }
Beispiel #14
0
 public void TestNotEmptyOrNullWithFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         ICollection <string> testVar = new List <string>();
         XAssert.That(testVar, IsNot.EmptyOrNull());
     });
 }
Beispiel #15
0
        public void TestNotEmptyOrNullWithTrue()
        {
            ICollection <string> testVar = new List <string> {
                "test"
            };

            XAssert.That(testVar, IsNot.EmptyOrNull());
        }
Beispiel #16
0
        public void No_match_if_inner_matcher_matches()
        {
            var isNot = new IsNot <string>(always);

            var matches = isNot.Matches("test");

            Assert.That(matches, Is.EqualTo(false));
        }
Beispiel #17
0
 public void TestNotEmptyWithFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         var testVar = new List <string>();
         XAssert.That(testVar, IsNot.Empty());
     });
 }
Beispiel #18
0
        public void No_match_if_inner_matcher_matches()
        {
            var isNot = new IsNot<string>(always);

            var matches = isNot.Matches("test");

            Assert.That(matches, Is.EqualTo(false));
        }
Beispiel #19
0
 public void TestsCanBeChainedSecondFails()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert
         .That("test2", IsNot.EmptyString())
         .And(Is.EqualTo("test"));
     });
 }
Beispiel #20
0
        public void TestNotEmptyWithTrue()
        {
            var testVar = new List <string>()
            {
                "test"
            };

            XAssert.That(testVar, IsNot.Empty());
        }
Beispiel #21
0
        public void TestChainedWithQueryTrue()
        {
            var myList = new List <int> {
                1, 2, 3
            };

            XAssert
            .That(myList, IsNot.Null <List <int> >())
            .And(m => m.Count, Is.EqualTo(3));
        }
Beispiel #22
0
 public void TestNotContainsItemFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         var test = new List <string> {
             "test2"
         };
         XAssert.That(test, IsNot.Storing("test2"));
     });
 }
        public virtual void TestPolicyNotSetByDefault()
        {
            StartUpCluster(false, -1);
            string MethodName = GenericTestUtils.GetMethodName();
            Path   path       = new Path("/" + MethodName + ".dat");

            MakeTestFile(path, 0, false);
            // Stat the file and check that the LAZY_PERSIST policy is not
            // returned back.
            HdfsFileStatus status = client.GetFileInfo(path.ToString());

            Assert.AssertThat(status.GetStoragePolicy(), IsNot.Not(LazyPersistPolicyId));
        }
Beispiel #24
0
        public void TestNotContainsWithQueryFalse()
        {
            var myList = new List <Person> {
                new Person {
                    Name = "Kaylee", Age = 33
                },
                new Person {
                    Name = "Cloud", Age = 29
                }
            };


            XAssert.That(myList, IsNot.Storing <Person>(l => l.Name == "Biff"));
        }
Beispiel #25
0
        public void TestNotContainsWithQueryTrue()
        {
            var myList = new List <Person> {
                new Person {
                    Name = "Kaylee", Age = 33
                },
                new Person {
                    Name = "Cloud", Age = 29
                }
            };

            Assert.Throws <XAssertionFailedException>(() =>
            {
                XAssert.That(myList, IsNot.Storing <Person>(l => l.Name == "Kaylee"));
            });
        }
        /// <exception cref="System.IO.IOException"/>
        public virtual void TestServiceRpcBindHostKey()
        {
            Configuration  conf    = new HdfsConfiguration();
            MiniDFSCluster cluster = null;

            Log.Info("Testing without " + DfsNamenodeServiceRpcBindHostKey);
            conf.Set(DfsNamenodeServiceRpcAddressKey, LocalhostServerAddress);
            // NN should not bind the wildcard address by default.
            try
            {
                cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(0).Build();
                cluster.WaitActive();
                string address = GetServiceRpcServerAddress(cluster);
                Assert.AssertThat("Bind address not expected to be wildcard by default.", address
                                  , IsNot.Not("/" + WildcardAddress));
            }
            finally
            {
                if (cluster != null)
                {
                    cluster.Shutdown();
                    cluster = null;
                }
            }
            Log.Info("Testing with " + DfsNamenodeServiceRpcBindHostKey);
            // Tell NN to bind the wildcard address.
            conf.Set(DfsNamenodeServiceRpcBindHostKey, WildcardAddress);
            // Verify that NN binds wildcard address now.
            try
            {
                cluster = new MiniDFSCluster.Builder(conf).NumDataNodes(0).Build();
                cluster.WaitActive();
                string address = GetServiceRpcServerAddress(cluster);
                Assert.AssertThat("Bind address " + address + " is not wildcard.", address, IS.Is
                                      ("/" + WildcardAddress));
            }
            finally
            {
                if (cluster != null)
                {
                    cluster.Shutdown();
                }
            }
        }
Beispiel #27
0
 public override void BeforeEachTest()
 {
     isNot = new IsNot();
     base.BeforeEachTest();
 }
Beispiel #28
0
        public void TestNotContainsRegexTrue()
        {
            var re = new Regex("bibble");

            XAssert.That("mystring", IsNot.MatchFor(re));
        }
Beispiel #29
0
 public void TestNotGreaterThanTrue()
 {
     XAssert.That(1, IsNot.GreaterThan(2));
 }
Beispiel #30
0
 public void TestIsNotTrueTrue()
 {
     XAssert.That(false, IsNot.True());
 }
Beispiel #31
0
 public void TestNotLessThanTrue()
 {
     XAssert.That(2, IsNot.LessThan(1));
 }
Beispiel #32
0
 public void TestIsNotFalseTrue()
 {
     XAssert.That(true, IsNot.False());
 }