Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Will you update NUnit?

Discussion in '2017.1 Beta' started by Deni35, Jun 18, 2017.

  1. Deni35

    Deni35

    Joined:
    Jul 10, 2012
    Posts:
    43
    The Unity 5.6 had got new version of NUnit.
    But looks like it's not the last version. Last NUnit have Warn, Assert.Multiple. This is very needed me features. But version of Unity 5.6 and 2017 hasn't this features :(.
    And how to check version of UNit?
     
    MrEsquire likes this.
  2. Tomek-Paszek

    Tomek-Paszek

    Unity Technologies

    Joined:
    Nov 13, 2012
    Posts:
    116
    Hi Deni35,
    There is not plan to update the version at the moment. We based on version 3.5. You can check the versino of nunit.framework.dll that is shipped with Unity
     
  3. Deni35

    Deni35

    Joined:
    Jul 10, 2012
    Posts:
    43
    I did a small useful wrapper for Assert.That method:

    Code (CSharp):
    1.  
    2.     public static class SoftAssert {
    3.  
    4.         public static bool ok { get; set; }
    5.  
    6.  
    7.         public static void That<TActual>(TActual actual, IResolveConstraint expression, string message = null, Object context = null) {
    8.             try {
    9.                 Assert.That( actual, expression, message );
    10.             } catch (AssertionException ex) {
    11.                 ok = false;
    12.                 Debug.LogWarning( ex.Message, context );
    13.             }
    14.         }
    15.  
    16.  
    17.         public static void That(bool condition, string message = null, Object context = null) {
    18.             try {
    19.                 Assert.That( condition, message );
    20.             } catch (AssertionException ex) {
    21.                 ok = false;
    22.                 Debug.LogWarning( ex.Message, context );
    23.             }
    24.         }
    25.  
    26.  
    27.     }
    28.  
    While this is enough. But I hope you will not to forget to update NUnit.