public ActionResult SendProposal(SubmitLogoViewModel submitLogoViewModel, HttpPostedFileBase file) { // to fix if (file == null) { return(PartialView("_Propose", submitLogoViewModel)); } string fileName = submitLogoViewModel.Name + "-candidate.png"; string path = System.IO.Path.Combine( Server.MapPath("~/Content/Domains/"), fileName); file.SaveAs(path); string logoPath = "~/Content/Domains/" + fileName; //var userId = User.Identity.GetUserId(); var userId = this.loggedInUser.GetUserId(); var domainName = submitLogoViewModel.Name + ".com"; this.domainService.UpdateDomainLogoPathAndDesignerId(domainName, logoPath, userId); TempData["Success"] = "Logo proposal for " + submitLogoViewModel.Name + " sent successfully!"; return(RedirectToAction("Index")); }
public void ConstructorShouldCreate_SubmitLogoViewModel_WithoutParams() { // Act & Assert var submitLogoViewModel = new SubmitLogoViewModel(); Assert.IsInstanceOf <SubmitLogoViewModel>(submitLogoViewModel); }
public ActionResult Propose(string name) { var submitLogoViewModel = new SubmitLogoViewModel() { Name = name }; return(PartialView("_Propose", submitLogoViewModel)); }
public void SubmitLogoViewModel_Should_Set_Properties_Correctly_With_CorrectData() { // Arrange var name = "name"; var submitLogoViewModel = new SubmitLogoViewModel() { Name = name }; // Act & Assert Assert.AreEqual(name, submitLogoViewModel.Name); }