public void WhereClauseWithGetDatePartMillisecond() { var store = new EntityStore(_dbConnection); var singleEmployee = store.GetSingle <Order>(o => SqlFunctions.GetMillisecond(o.OrderDate) >= 0); Xunit.Assert.NotNull(singleEmployee); }
public void WhereClauseThrowsException() { var store = new EntityStore(_dbConnection); string NO_DATETIME_SUPPORT = "SqlFunction does not support DateTime functions or variables. It supports DateTime Entity Types"; var singleEmployee = store.GetSingle <Order>(o => SqlFunctions.GetMillisecond(o.OrderDate) >= 0); var ex = Xunit.Assert.Throws <Exception>(() => store.GetSingle <Order>(o => SqlFunctions.GetMillisecond(DateTime.Now) >= 0)); Xunit.Assert.Equal(NO_DATETIME_SUPPORT, ex.Message); }