public void ThrowOnIndexingIgnoredColumn() { var config = NeedToDash.Configure(); config.Setup <Post>().Property(p => p.Title).Ignore(); Assert.Throws <InvalidOperationException>(() => config.Setup <Post>().Index(p => p.Title)); }
public void ThrowOnIndexingIgnoredColumn() { var config = NeedToDash.Configure(new ConnectionStringSettings("Default", string.Empty, "System.Data.SqlClient")); config.Setup <Post>().Property(p => p.Title).Ignore(); Assert.Throws <InvalidOperationException>(() => config.Setup <Post>().Index(p => p.Title)); }
public void UniqueAddedCorrectly() { var config = NeedToDash.Configure(new ConnectionStringSettings("Default", string.Empty, "System.Data.SqlClient")); config.Setup <Blog>(); config.Setup <User>(); config.Setup <Post>().Index(p => new { p.Rating, p.Title }, true); Assert.True(config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).IsUnique); }
public void UniqueAddedCorrectly() { var config = NeedToDash.Configure(); config.Setup <Blog>(); config.Setup <User>(); config.Setup <Post>().Index(p => new { p.Rating, p.Title }, true); Assert.True(config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).IsUnique); }
public void SingleColumnAddedCorrectly() { var config = NeedToDash.Configure(); config.Setup <Blog>(); config.Setup <User>(); config.Setup <Post>().Index(p => p.Title); Assert.Equal(1, config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 1).Columns.Count(c => c.Name == "Title")); }
public void IndexExtensionWorks() { var config = NeedToDash.Configure(new ConnectionStringSettings("Default", string.Empty, "System.Data.SqlClient")); config.Setup <Blog>(); config.Setup <User>(); config.Setup <Post>().Index(p => new { p.Rating, p.Title }); Assert.Equal(1, config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).Columns.Count(c => c.Name == "Rating")); Assert.Equal(1, config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).Columns.Count(c => c.Name == "Title")); }
public void IndexExtensionWorks() { var config = NeedToDash.Configure(); config.Setup <Blog>(); config.Setup <User>(); config.Setup <Post>().Index(p => new { p.Rating, p.Title }); Assert.Equal(1, config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).Columns.Count(c => c.Name == "Rating")); Assert.Equal(1, config.GetMap <Post>().Indexes.First(i => i.Columns.Count == 2).Columns.Count(c => c.Name == "Title")); }
public void ThrowOnOddIndexExpression() { var config = NeedToDash.Configure(new ConnectionStringSettings("Default", string.Empty, "System.Data.SqlClient")); Assert.Throws <InvalidOperationException>(() => config.Setup <Post>().Index(p => new { Blah = p.Title })); }
public void ThrowOnOddIndexExpression() { var config = NeedToDash.Configure(); Assert.Throws <InvalidOperationException>(() => config.Setup <Post>().Index(p => new { Blah = p.Title })); }