public void TestSearchIsValid01() { var testSubject = new Search { GetConductorOfSearch = lps => lps.FirstOrDefault(lp => lp is ExampleLawEnforcement), ExpectationOfPrivacy = new ExpectationOfPrivacy { GetSubjectOfSearch = lps => lps.FirstOrDefault(lp => lp is ExamplePersonSearched), Consent = Consent.IsGiven(), IsPrivacyExpected = lp => false, IsPrivacyExpectedReasonable = lp => false } }; var testResult = testSubject.IsValid(new ExamplePersonSearched(), new ExampleLawEnforcement()); Console.WriteLine(testSubject.ToString()); Assert.IsTrue(testResult); }
public void TestIsValidWithConsent() { const string MA = "Massachusetts"; const string GA = "Georgia"; var testSubject = new PersonalJurisdiction(new StateCourt(MA)) { Consent = Consent.NotGiven(), GetDomicileLocation = lp => lp is ExampleDefendant ? new VocaBase(GA) : new VocaBase(MA), GetCurrentLocation = lp => lp is ExampleDefendant ? new VocaBase(GA) : new VocaBase(MA), GetInjuryLocation = lp => lp is ExamplePlaintiff ? new VocaBase(MA) : null }; var testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant()); Assert.IsFalse(testResult); Console.WriteLine(testSubject.ToString()); testSubject.Consent = Consent.IsGiven(); testResult = testSubject.IsValid(new ExamplePlaintiff(), new ExampleDefendant()); Assert.IsTrue(testResult); Console.WriteLine(testSubject.ToString()); }