public void CommerceInsvBayerCorp() { var testSubject = new Agreement { IsApprovalExpressed = lp => true, TermsOfAgreement = lp => { var commerceIns = lp as CommerceIns; if (commerceIns != null) { return(commerceIns.GetTerms()); } var bayer = lp as BayerCorp; if (bayer != null) { return(bayer.GetTerms()); } return(new HashSet <Term <object> >()); } }; var testResult = testSubject.GetAgreedTerms(new CommerceIns(), new BayerCorp()); Assert.IsNotNull(testResult); Assert.IsTrue(testResult.Count == 1); //Bayer wanted the "arbitration provision" but its gone Assert.IsTrue(testResult.Any(t => t.Name == "bulk nylon fiber")); }
public void FlenderCorpvTippins() { var testSubject = new Agreement { IsApprovalExpressed = lp => true, TermsOfAgreement = lp => { var flender = lp as FlenderCorp; if (flender != null) { return(flender.GetTerms()); } var tippins = lp as Tippins; if (tippins != null) { return(tippins.GetTerms()); } return(new HashSet <Term <object> >()); } }; var testResult = testSubject.GetAgreedTerms(new FlenderCorp(), new Tippins()); Assert.IsNotNull(testResult); //knockout rule where two terms with different meanings are not included in set-union Assert.IsTrue(testResult.All(t => t.Name != "arbitration provision")); Console.WriteLine(testSubject.ToString()); }