public void LocalMemberChain() { ПрочиеДоходыИРасходы value = null; var exception = Assert.Throws <InvalidOperationException>(() => value = Source <ПрочиеДоходыИРасходы>() .Single(x => LocalWrapFunc(x.Наименование).s == ".")); Assert.That(value, Is.Null); const string expectedMessage = "can't apply 'Where' operator for " + "expression [(LocalWrapFunc([x].Наименование).s == \".\")]." + "Expression must be a chain of member accesses."; Assert.That(exception.Message, Is.EqualTo(expectedMessage)); }
public void GracefullCrashForInvalidOrderByExpression() { ПрочиеДоходыИРасходы value = null; var exception = Assert.Throws <InvalidOperationException>(() => value = Source <ПрочиеДоходыИРасходы>() .OrderByDescending(x => LocalFunc(x.Наименование)) .Single()); Assert.That(value, Is.Null); const string expectedMessage = "can't apply [OrderByDescending] operator by " + "expression [LocalFunc([x].Наименование)]." + "Expression must be a chain of member accesses."; Assert.That(exception.Message, Is.EqualTo(expectedMessage)); }