public void CreateUserIndicator() { UserLogic ul = new UserLogic(null); User u = ul.GetUserByID(1); IndicatorLogic il = new IndicatorLogic(null); Indicator i2 = il.GetById(2); List <Indicator> ia = ul.GetAllIndicators(u); ul.AddIndicator(u, i2); ul.ShowIndicator(u, i2); List <Indicator> reorder = ul.GetAllIndicators(u); //il.DeleteIndicator(i2.ID); Assert.AreEqual(1, reorder.Count()); }
public void AddIndicatorToAdminTest() { Indicator indicator = new Indicator { }; var user = new User(); user.Admin = true; var mock = new Mock <IRepository <User> >(MockBehavior.Strict); mock.Setup(m => m.Has(It.IsAny <User>())).Returns(true); IUserLogic userLogic = new UserLogic(mock.Object); userLogic.AddIndicator(user, indicator); mock.VerifyAll(); }