public void ToStringTest() { //Arrange DateTime DTTester = DateTime.Now; var expected = $"Name: test.txt Date Created: {DTTester} Path: c: Size: 1000"; //Act File actual = new File("test.txt", DTTester, "c:", (long)1000, "txt"); //Assert Assert.AreEqual(expected, actual.ToString()); }
public void SaveTest() { //Arrange DateTime DTTester = DateTime.Now; var file = new File("test.txt", DTTester, "c:", (long)1000, "txt"); var archiveInfo = new Archive("test", System.IO.DriveType.Fixed, "nolabel"); //var listOfFiles = new List<IFile>(); //listOfFiles.Add(file); //var catalog = new Catalog(archiveInfo, listOfFiles); //Act using (var ctx = new EFRepositoryContext()) { ctx.Files.Add(file); ctx.Archives.Add(archiveInfo); ctx.SaveChanges(); } //Assert Assert.Fail(); }