????5???????ж?

????IsInstanceOfType/ IsNotInstanceOfType????/?????????????????2.5??????????

???????磺

    publicclassPerson 
    { 
    publicstringname {set;get;} 
    } 
    Person p = newPerson(); 
    p.name = "a"; 
    Assert.IsInstanceOf(typeof(Person)?? p);//????ж? 
    Assert.IsInstanceOf(typeof(System.String)?? p);//????????ж?

????6?????ж?

????Throws????????????????

????DoesNotThrow??????????????????

????7??????????????

????Pass??????ò??????

????Fail??????ò??????

????Ignore??????ò??????

????Inconclusive??δ????ò???

????????StringAssert??

????StringAssert????String?????????ж??

????StringAssert.Contains???????????

????StringAssert.StartsWith??????????????

????StringAssert.EndsWith?????????????β

????StringAssert.AreEqualIgnoringCase??????????????????????Сд????

????StringAssert.IsMatch????????(??????????????????????)

?????????

    strings1 = "abc"; 
    ??StringAssert.Contains("b"?? s1); 
    ??StringAssert.StartsWith("a"?? s1); 
    StringAssert.EndsWith("c"?? s1); 
    strings2 = "aBc"; 
    StringAssert.AreEqualIgnoringCase(s1?? s2); 
    StringAssert.IsMatch("[a|book]"?? "123");

????????CollectionAssert??

????AllItemsAreInstancesOfType???????е???????????????????

????AllItemsAreNotNull:?????е??????????

????AllItemsAreUnique???????е????

????AreEqual?????????????

????AreEquivalent????????????

????AreNotEqual??????????????

????AreNotEquivalent?????????????

????DoesNotContain???????в??????????

????IsSubsetOf:????????????????????????

????IsNotSubsetOf:?????????????????????????

????IsEmpty?????????

????IsNotEmpty??????????

????IsOrdered?????????????????

?????????

    Lista = newList(); 
    Listb = newList(); 
    CollectionAssert.IsEmpty(a); 
    for(inti = 1;i <= 10;i++) 
    { 
    a.Add(i); 
    b.Add(i); 
    } 
    CollectionAssert.AreEqual(a?? b); 
    CollectionAssert.IsOrdered(a); 
    b.Remove(1); 
    CollectionAssert.IsSubsetOf(b?? a); 
    CollectionAssert.AreEqual(a?? b);

????????????NUnit????????????Щ???????????????????????.Net????????????????NUnit????????????????????????NUnit????????????????????