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

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

            XAssert.That(testVar, IsNot.EmptyOrNull());
        }
Example #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));
        }
Example #17
0
 public void TestNotEmptyWithFalse()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         var testVar = new List <string>();
         XAssert.That(testVar, IsNot.Empty());
     });
 }
Example #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));
        }
Example #19
0
 public void TestsCanBeChainedSecondFails()
 {
     Assert.Throws <XAssertionFailedException>(() =>
     {
         XAssert
         .That("test2", IsNot.EmptyString())
         .And(Is.EqualTo("test"));
     });
 }
Example #20
0
        public void TestNotEmptyWithTrue()
        {
            var testVar = new List <string>()
            {
                "test"
            };

            XAssert.That(testVar, IsNot.Empty());
        }
Example #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));
        }
Example #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));
        }
Example #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"));
        }
Example #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();
                }
            }
        }
Example #27
0
 public override void BeforeEachTest()
 {
     isNot = new IsNot();
     base.BeforeEachTest();
 }
Example #28
0
        public void TestNotContainsRegexTrue()
        {
            var re = new Regex("bibble");

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