public void IsAuthorized_ReturnsTrue() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(context); Assert.IsTrue(controller.BaseIsAuthorized(TableOperation.None, null)); }
public void CtorWithRepository_SetsTableRepository() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(context); Assert.IsNotNull(controller.TableRepository); }
public void TableRepository_ThrowsIfSetNull() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(context); controller.TableRepository = null; Assert.Fail("ArgumentNullException expected"); }
public void TableRepository_ThrowsIfSetTwice() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(context); controller.TableRepository = new EntityTableRepository <Movie>(context); Assert.Fail("InvalidOperationException expected"); }
public void TableRepository_Roundtrips() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(); controller.TableRepository = new EntityTableRepository <Movie>(context); Assert.IsNotNull(controller.TableRepository); }
public void PrepareItemForStore_ReturnsSelf() { var context = MovieDbContext.InMemoryContext(); var controller = new MoviesController(context); var testItem = new Movie() { Title = "foo" }; Assert.AreEqual(testItem, controller.BasePrepareItemForStore(testItem)); }