comparison API/Objects/Requirement/Validation.cs @ 354:47acc63cf529

Re #27: Unit requirements * Bit mask the values with a bitwise AND rather than an OR
author IBBoard <dev@ibboard.co.uk>
date Fri, 22 Apr 2011 10:38:03 +0000
parents 50cd43bf51b3
children
comparison
equal deleted inserted replaced
353:65fccdd51aec 354:47acc63cf529
30 /// <param name='passed'> 30 /// <param name='passed'>
31 /// The Validation enum value to check 31 /// The Validation enum value to check
32 /// </param> 32 /// </param>
33 public static bool AsOkay(Validation result) 33 public static bool AsOkay(Validation result)
34 { 34 {
35 return (result | Validation.Passed) == Validation.Passed; 35 return (result & Validation.Passed) == Validation.Passed;
36 } 36 }
37 37
38 /// <summary> 38 /// <summary>
39 /// Checks if the validation result was not okay (failed or not applicable). Note that this is different 39 /// Checks if the validation result was not okay (failed or not applicable). Note that this is different
40 /// to <code>!Validates.AsOkay(result)</code> because this method treats not applicable as not being okay. 40 /// to <code>!Validates.AsOkay(result)</code> because this method treats not applicable as not being okay.
45 /// <param name='result'> 45 /// <param name='result'>
46 /// The Validation enum value to check 46 /// The Validation enum value to check
47 /// </param> 47 /// </param>
48 public static bool AsNotOkay (Validation result) 48 public static bool AsNotOkay (Validation result)
49 { 49 {
50 return (result | Validation.Failed) == Validation.Failed; 50 return (result & Validation.Failed) == Validation.Failed;
51 } 51 }
52 } 52 }
53 } 53 }
54 54