public ActionResult FindByParams(InventorsView param, bool test = false) { ViewBag.UserName = AuthenticationManager.User.Identity.Name; if (!test) { _s = _inventor.Get(); } string id = param.Id; if (param.Id != null) { _s = _s.Where(x => x.InventorId.ToString() == id).Select(x => x); } string inventorName = param.Name; if (param.Name != null) { _s = _s.Where(x => x.FullName == inventorName).Select(x => x); } string email = param.Email; if (param.Email != null) { _s = _s.Where(x => x.Email == email).Select(x => x); } string adress = param.Adress; if (param.Adress != null) { _s = _s.Where(x => x.Adress == adress).Select(x => x); } return(View("InventorsTable", _s)); }
public static void InventorsViewTest() { var view = new InventorsView { Id = "0", Adress = "south", Email = "kfn@dkfm", Name = "djkfv" }; Assert.Equal("south", view.Adress); }