public LibrarySystemEfWrapper(ILibrarySystemEfDbContext context) { Guard.WhenArgument(context, "context").IsNull().Throw(); this.Context = context; this.DbSet = this.Context.Set <T>(); }
public void ThrowArgumentNullException_WhenPassedContextIsNull() { // Arrange ILibrarySystemEfDbContext context = null; // Act & Assert Assert.That(() => new LibrarySystemEfWrapper <IBook>(context), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("context")); }
public void Constructor_ShouldThrowArgumentNullException_WhenContextIsNull() { // Arrange ILibrarySystemEfDbContext context = null; // Act & Assert Assert.That( () => new LibrarySystemEfDbContextSaveChanges(context), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("context")); }
public LibrarySystemEfDbContextSaveChanges(ILibrarySystemEfDbContext context) { Guard.WhenArgument(context, "context").IsNull().Throw(); this.context = context; }