public void DropCreateNewDatabase() { using (SoundboardServiceContext context = new SoundboardServiceContext( SoundboardServiceContext.DBCreationMethod.DropCreateAlways)) { Channel globalChannel = context.Channels .FirstOrDefault(channel => channel.Name == "Global"); Assert.IsNotNull(globalChannel); } }
public void DisallowNullNames() { using (SoundboardServiceContext context = new SoundboardServiceContext()) { Channel nullNameChannel = new Channel() { Name = null }; context.Channels.Add(nullNameChannel); context.SaveChanges(); } }