Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void ensureNotNull()
        public virtual void ensureNotNull()
        {
            string @string = "string";

            try
            {
                EnsureUtil.ensureNotNull("string", @string);
            }
            catch (System.ArgumentException e)
            {
                fail("Not expected the following exception: ", e);
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFailEnsureNotNull()
        public virtual void shouldFailEnsureNotNull()
        {
            string @string = null;

            try
            {
                EnsureUtil.ensureNotNull("string", @string);
                fail("Expected: IllegalArgumentException");
            }
            catch (System.ArgumentException)
            {
                // happy path
            }
        }