public void ExcludeTest() { GXUser user = new GXUser() { Id = "Default" }; GXUserGroup item = new GXUserGroup() { Name = "Default" }; item.Users.Add(user); GXInsertArgs insert = GXInsertArgs.Insert(item); insert.Exclude <GXUserGroup>(e => e.CreationTime); insert.Exclude <GXUserGroup>(e => e.Users); Assert.AreEqual("Mikko", insert.ToString()); }
public void ExcludeInsertTest() { TestClass t = new TestClass(); t.Text = "Gurux"; GXInsertArgs args = GXInsertArgs.Insert(t); args.Exclude <TestClass>(x => new { x.Time, x.Text2, x.Text3, x.Text4, x.BooleanTest, x.IntTest, x.DoubleTest, x.FloatTest, x.Span, x.Object, x.Status }); Assert.AreEqual("INSERT INTO TestClass (`Guid`, `Text`) VALUES('00000000000000000000000000000000', 'Gurux')", args.ToString()); }
public void CultureTest() { List <GXLanguage> list = new List <GXLanguage>(); list.Add(new GXLanguage() { Id = "fi", EnglishName = "Finland", }); GXInsertArgs insert = GXInsertArgs.InsertRange(list); insert.Exclude <GXConfigurationValue>(e => e.Group); Assert.AreEqual("Mikko", insert.ToString()); }
public void InsertSettingsTest() { List <GXConfigurationValue> list = new List <GXConfigurationValue>(); list.Add(new GXConfigurationValue() { Name = "SiteName", }); list.Add(new GXConfigurationValue() { Name = "Email", }); list.Add(new GXConfigurationValue() { Name = "Slogan", }); // GXInsertArgs insert = GXInsertArgs.InsertRange(list, c => new { c.Id, c.Generation }); GXInsertArgs insert = GXInsertArgs.InsertRange(list); insert.Exclude <GXConfigurationValue>(e => e.Group); Assert.AreEqual("Mikko", insert.ToString()); }