예제 #1
0
 public static ActualValue <string?> IsNullOrEmpty(this ActualValue <string?> expectation) =>
 expectation.Assert(
     string.IsNullOrEmpty(expectation.Value),
     () => new EqualAssertException($""));
예제 #2
0
 public static ActualValue <T> IsNotEqualTo <T>(this ActualValue <T> expectation, T expectedValue, IEqualityComparer <T> comparer) =>
 expectation.Assert(
     !comparer.Equals(expectation.Value, expectedValue),
     () => new EqualAssertException($""));
예제 #3
0
 public static ActualValue <T> And <T>(this ActualValue <T> expectation) => expectation;
예제 #4
0
 public static ActualValue <DateTime> IsEqualTo(this ActualValue <DateTime> expectation, DateTime expectedValue, TimeSpan precision) =>
 expectation.Assert(
     (expectedValue - expectation.Value).Duration() > precision,
     () => new EqualAssertException($""));
예제 #5
0
 public static ActualValue <float> IsEqualTo(this ActualValue <float> expectation, float expectedValue, float precision) =>
 expectation.Assert(
     expectedValue - expectation.Value > precision,
     () => new EqualAssertException($""));
 public static ActualValue <IDictionary <TKey, TValue> > DoesNotContainKey <TKey, TValue>(this ActualValue <IDictionary <TKey, TValue> > expectation, TKey expectedKey) =>
 expectation.Assert(
     !expectation.Value.ContainsKey(expectedKey),
     () => new EqualAssertException($""));
 public static ActualValue <IDictionary <TKey, TValue> > DoesNotHaveLengthOf <TKey, TValue>(this ActualValue <IDictionary <TKey, TValue> > expectation, int expectedLength) =>
 expectation.Assert(
     expectation.Value.Count != expectedLength,
     () => new EqualAssertException($""));
예제 #8
0
 public static ActualValue <string> DoesNotContain(this ActualValue <string> expectation, string expectedValue, StringComparison comparison) =>
 expectation.Assert(
     !expectation.Value.Contains(expectedValue, comparison),
     () => new EqualAssertException($""));
 public static ActualValue <ISet <T> > IsProperSubsetOf <T>(this ActualValue <ISet <T> > expectation, ISet <T> expectedSuperset) =>
 expectation.Assert(
     expectation.Value.IsProperSubsetOf(expectedSuperset),
     () => new EqualAssertException($""));
예제 #10
0
 public static ActualValue <string> Contains(this ActualValue <string> expectation, string expectedValue) =>
 expectation.Assert(
     expectation.Value.Contains(expectedValue),
     () => new EqualAssertException($""));
예제 #11
0
 public static ActualValue <string> StartsWith(this ActualValue <string> expectation, string expectedValue, StringComparison comparison) =>
 expectation.Assert(
     expectation.Value.StartsWith(expectedValue, comparison),
     () => new EqualAssertException($""));
예제 #12
0
 public static ActualValue <string> Matches(this ActualValue <string> expectation, Regex expectedRegex) =>
 expectation.Assert(
     expectedRegex.IsMatch(expectation.Value),
     () => new EqualAssertException($""));
예제 #13
0
 public static ActualValue <string> Matches(this ActualValue <string> expectation, string expectedPattern) =>
 expectation.Assert(
     Regex.IsMatch(expectation.Value, expectedPattern),
     () => new EqualAssertException($""));
예제 #14
0
 public static ActualValue <string?> IsNotNullNorWhitespace(this ActualValue <string?> expectation) =>
 expectation.Assert(
     !string.IsNullOrWhiteSpace(expectation.Value),
     () => new EqualAssertException($""));
 public static ActualValue <IDictionary <TKey, TValue> > Contains <TKey, TValue>(this ActualValue <IDictionary <TKey, TValue> > expectation, TValue expectedValue) =>
 expectation.Assert(
     expectation.Value.Values.Contains(expectedValue, EqualityComparer <TValue> .Default),
     () => new EqualAssertException($""));
 public static ActualValue <T[]> IsNotEmpty <T>(this ActualValue <T[]> expectation) =>
 expectation.Assert(
     expectation.Value.Length != 0,
     () => new EqualAssertException($""));
 public static ActualValue <IDictionary <TKey, TValue> > IsNotEmpty <TKey, TValue>(this ActualValue <IDictionary <TKey, TValue> > expectation) =>
 expectation.Assert(
     expectation.Value.Count != 0,
     () => new EqualAssertException($""));
 public static ActualValue <T[]> DoesNotHaveLengthOf <T>(this ActualValue <T[]> expectation, int expectedLength) =>
 expectation.Assert(
     expectation.Value.Length != expectedLength,
     () => new EqualAssertException($""));
 public static ActualValue <IDictionary <TKey, TValue> > DoesNotContainValue <TKey, TValue>(this ActualValue <IDictionary <TKey, TValue> > expectation, TValue expectedValue, IEqualityComparer <TValue> comparer) =>
 expectation.Assert(
     !expectation.Value.Values.Contains(expectedValue, comparer),
     () => new EqualAssertException($""));
 public static ActualValue <T[]> Contains <T>(this ActualValue <T[]> expectation, T expectedValue) =>
 expectation.Assert(
     Array.IndexOf(expectation.Value, expectedValue) >= 0,
     () => new EqualAssertException($""));
예제 #21
0
 public static ActualValue <decimal> IsEqualTo(this ActualValue <decimal> expectation, decimal expectedValue, decimal precision) =>
 expectation.Assert(
     expectedValue - expectation.Value > precision,
     () => new EqualAssertException($""));
예제 #22
0
 public static ActualValue <ICollection <T> > HasLengthOf <T>(this ActualValue <ICollection <T> > expectation, int expectedLength) =>
 expectation.Assert(
     expectation.Value.Count == expectedLength,
     () => new EqualAssertException($""));
예제 #23
0
 public static ActualValue <bool> IsFalse(this ActualValue <bool> expectation) =>
 expectation.Assert(
예제 #24
0
 public static ActualValue <ICollection <T> > IsNotEmpty <T>(this ActualValue <ICollection <T> > expectation) =>
 expectation.Assert(
     expectation.Value.Count != 0,
     () => new EqualAssertException($""));
예제 #25
0
 public static ActualValue <T> IsEqualTo <T>(this ActualValue <T> expectation, T expectedValue) =>
 expectation.Assert(
     EqualityComparer <T> .Default.Equals(expectation.Value, expectedValue),
     () => new EqualAssertException($""));
예제 #26
0
 public static ActualValue <ICollection <T> > DoesNotContain <T>(this ActualValue <ICollection <T> > expectation, T expectedValue, IEqualityComparer <T> comparer) =>
 expectation.Assert(
     !expectation.Value.Contains(expectedValue, comparer),
     () => new EqualAssertException($""));
예제 #27
0
 public static ActualValue <T> Satisfies <T>(this ActualValue <T> expectation, Func <T, bool> check) =>
 expectation.Assert(
     check(expectation.Value),
     () => new EqualAssertException($""));
예제 #28
0
 public static ActualValue <ICollection <T> > Contains <T>(this ActualValue <ICollection <T> > expectation, T expectedValue) =>
 expectation.Assert(
     expectation.Value.Contains(expectedValue, EqualityComparer <T> .Default),
     () => new EqualAssertException($""));
 public static ActualValue <T> Is <T>(this ActualValue <T> expectation, Type expectedType) =>
 expectation.Assert(
예제 #30
0
 public static ActualValue <string> IsEmpty(this ActualValue <string> expectation) =>
 expectation.Assert(
     expectation.Value.Length == 0,
     () => new EqualAssertException($""));