Exemplo n.º 1
0
 public static void Asserts(Test test)
 {
     var instance = new object();
     test.NotNull(new object());
     test.Null(null);
     test.True(true);
     test.False(false);
     test.Equal(1, 1);
     test.Equal("hello world", "hello world");
     test.Equal(true, true);
     test.NotEqual(true, false);
     test.NotEqual(1, 2);
     test.NotEqual("hello", "world");
     test.HasSubstring("ello", "hello");
     test.HasSubstring("eLLo", "HELLo", StringComparison.InvariantCultureIgnoreCase);
     test.Same(instance, instance);
     test.NotSame(instance, new object());
     test.Empty(new string[0]);
     test.Empty(new List<string>());
     test.NotEmpty(new string[]{"hello"});
     test.NotEmpty(new List<string> { "hello" });
     test.Throws(delegate { throw new ApplicationException("hi"); });
     test.Throws(delegate { throw new ApplicationException("hi"); }, (ex) => test.Equal("hi", ex.Message));
     test.Throws<ApplicationException>(delegate { throw new ApplicationException("hi"); }, (ex) => test.Equal("hi", ex.Message));
     test.Throws<ApplicationException>(delegate { throw new ApplicationException("hi"); });
     test.Throws(delegate { throw new ApplicationException("hi"); }, typeof(ApplicationException));
     test.DoesNotThrow(delegate {
         test.Equal(1, 1);
     }, typeof(Exception));
     test.DoesNotThrow(delegate {
         throw new Exception();
     }, typeof(ApplicationException));
 }
Exemplo n.º 2
0
 public static void WithDependencies(Test test)
 {
     test.True(true);
 }
Exemplo n.º 3
0
 public static void PublicStatic(Test test)
 {
     test.True(true);
 }
Exemplo n.º 4
0
 private void privateInstance(Test test)
 {
     test.True(true);
 }
Exemplo n.º 5
0
 private static void privateStatic(Test test)
 {
     test.True(true);
 }
Exemplo n.º 6
0
 public void PublicInstance(Test test)
 {
     test.True(true);
 }