public void Test42ExistsFaild() { var deferredValue1 = DeferredValue.Create(() => 352, 12, "Months in year"); var deferredValue2 = DeferredValue.Create(() => 352, 420, "Answer to the Ultimate Question of Life, The Universe, and Everything"); var deferredValue3 = DeferredValue.Create(() => 352, 56, "Random int"); var deferredValues = new[] {deferredValue1, deferredValue2, deferredValue3}; deferredValues.Wait().ThatNunit(Is.SupersetOf(new[] {42})); }
public void Test42ExistsWithTransformation() { var deferredValue1 = DeferredValue.Create(() => "352", "12", "Months in year"); var deferredValue2 = DeferredValue.Create(() => "352", "42", "Answer to the Ultimate Question of Life, The Universe, and Everything"); var deferredValue3 = DeferredValue.Create(() => "352", "56", "Random int"); var deferredValues = new[] {deferredValue1, deferredValue2, deferredValue3}; deferredValues.Wait().Transformed(x => Array.ConvertAll(x, int.Parse)).ThatNunit(Is.SupersetOf(new[] {42})); }
public void Test42ExistsFaild() { var deferredValue1 = DeferredValue.Create(() => 352, 12, "Months in year"); var deferredValue2 = DeferredValue.Create(() => 352, 420, "Answer to the Ultimate Question of Life, The Universe, and Everything"); var deferredValue3 = DeferredValue.Create(() => 352, 56, "Random int"); var deferredValues = new[] { deferredValue1, deferredValue2, deferredValue3 }; deferredValues.Wait().ThatFluent(x => x.Should().Contain(42, "answer is 42")); }
public void Test42Single() { var deferredValue1 = DeferredValue.Create(() => "352", "12", "Months in year"); var deferredValue2 = DeferredValue.Create(() => "352", "42", "Answer to the Ultimate Question of Life, The Universe, and Everything"); var deferredValue3 = DeferredValue.Create(() => "352", "56", "Random int"); var deferredValues = new[] {deferredValue1, deferredValue2, deferredValue3}; var result = deferredValues.Wait().Single(x => x.Assert(Is.EqualTo("42")), Helper.AssertionConfiguration); Assert.That(result, Is.EqualTo("42")); }
public void Test42Filtered() { var deferredValue1 = DeferredValue.Create(() => "352", "12", "Months in year"); var deferredValue2 = DeferredValue.Create(() => "352", "42", "Answer to the Ultimate Question of Life, The Universe, and Everything"); var deferredValue3 = DeferredValue.Create(() => "352", "56", "Random int"); var deferredValues = new[] {deferredValue1, deferredValue2, deferredValue3}; var result = deferredValues.Wait().Filtered(x => x.Assert(Is.EqualTo("42"))).ThatNunit(Has.Length.EqualTo(1)).GetAsserted(); Assert.That(result, Is.EqualTo(new[] {"42"})); }
public void Test42WithTransformation() { var deferredValue = DeferredValue.Create(() => "352", "42", "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().Transformed(int.Parse).ThatNunit(Is.EqualTo(42)); }
public void Test42FailedByException() { var deferredValue = DeferredValue.Create(() => 352, () => throw new Exception(":("), "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().ThatNunit(Is.EqualTo(42)); }
public void Test42Wrong() { var deferredValue = DeferredValue.Create(() => 352, 420, "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().ThatNunit(Is.EqualTo(42)); }
public void Test42WithTransformation() { var deferredValue = DeferredValue.Create(() => "352", "42", "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().Transformed(int.Parse).ThatFluent(x => x.Should().Be(42, "answer is 42")); }
public void Test42FailedByException() { var deferredValue = DeferredValue.Create(() => 352, () => throw new Exception(":("), "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().ThatFluent(x => x.Should().Be(42, "answer is 42")); }
public void Test42Wrong() { var deferredValue = DeferredValue.Create(() => 352, 420, "Answer to the Ultimate Question of Life, The Universe, and Everything"); deferredValue.Wait().ThatFluent(x => x.Should().Be(42, "answer is 42")); }