public void TestUpdateCurrentSalonSettings() { test = new GiftCardMSSQLDAO(); var salon = createTestCompanyModel(); Assert.IsTrue(test.UpdateSalon(salon)); var img = loadImage(); var logo_id = test.SaveUploadedFile(new UploadedFile() { CompanyId = salon.Id.Value, FileLength = img.Length, FileName = "mylogo.jpg" }); var input = new CurrentCompanyDisplaySettings() { CompanyId = salon.Id, CurrentThemeName = "Test theme" }; var ret = test.UpdateCompanySettings(input, logo_id.Value); Assert.IsNotNull(ret); input.CurrentThemeName = "Test theme 2"; ret = test.UpdateCompanySettings(input, logo_id.Value); Assert.IsNotNull(ret); var result = test.RetrieveDisplaySettings(salon.Id.Value); }
public void TestSaveUploadedFile() { test = new GiftCardMSSQLDAO(); var salon = createTestCompanyModel(); Assert.IsTrue(test.UpdateSalon(salon)); var img = loadImage(); var input = new UploadedFile() { FileLength = img.Length, FileName = "mylogo.jpg" }; var logo_id = test.SaveUploadedFile(input); Assert.IsNotNull(logo_id); Assert.IsTrue(logo_id.HasValue); var result = test.RetrieveLogoFileInfoForClient(salon.Id.Value); Assert.IsNotNull(result); Assert.AreEqual(input.FileLength, result.FileLength); Assert.AreEqual(input.FileName, result.FileName); }