1 // -----------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation. All rights reserved.
3 // -----------------------------------------------------------------------
5 using System
.ComponentModel
;
6 using System
.Diagnostics
;
7 using System
.Diagnostics
.CodeAnalysis
;
8 using System
.Globalization
;
9 using System
.Runtime
.Serialization
;
11 namespace Microsoft
.Internal
13 internal static partial class Assumes
16 internal static void NotNull
<T
>(T
value)
19 IsTrue(value != null);
23 internal static void NotNull
<T1
, T2
>(T1 value1
, T2 value2
)
32 internal static void NotNull
<T1
, T2
, T3
>(T1 value1
, T2 value2
, T3 value3
)
43 internal static void NotNullOrEmpty
<T
>(T
[] values
)
45 Assumes
.NotNull(values
);
46 Assumes
.IsTrue(values
.Length
> 0);
50 internal static void NotNullOrEmpty(string value)
53 IsTrue(value.Length
> 0);
57 internal static void Null
<T
>(T
value)
60 IsTrue(value == null);
64 internal static void IsFalse(bool condition
)
73 internal static void IsTrue(bool condition
)
82 internal static void IsTrue(bool condition
, [Localizable(false)]string message
)
91 internal static void Fail([Localizable(false)]string message
)
93 throw new InternalErrorException(message
);
97 internal static T NotReachable
<T
>()
99 throw new InternalErrorException("Code path should never be reached!");