public void SaveTest_ParamFailure() { // arrange DashboardFileFactory target = new DashboardFileFactory(); // act try { target.Save(null); Assert.Fail("exception not thrown"); } catch (ArgumentNullException) { } catch { Assert.Fail("Invalid exception"); } }
public void SaveTest_Success() { // arrange DashboardFileFactory target = new DashboardFileFactory(); DashboardFile file = target.CreateFile(this.contents, this.filename); // act target.Save(file); // assert Assert.IsTrue(File.Exists(file.FileName)); // cleanup File.Delete(file.FileName); }
public void ReadTest_Success() { // arrange DashboardFileFactory target = new DashboardFileFactory(); DashboardFile file = target.CreateFile(this.contents, this.filename); target.Save(file); // act string actual = target.Read(file); // assert Assert.AreEqual(this.contents, actual); // cleanup File.Delete(file.FileName); }