public void CompareFileTestBlockSizeone() { FloorPlan image1 = new FloorPlan(new Bitmap("../../testImage.jpg"), 5); image1.printArray("../../testImagecomp_block5.txt"); int filebyte1; int filebyte2; // fs1 contains the newly created array file while fs2 contains the standard to check against for this block size 5 FileStream fs1 = new FileStream("../../testImagecomp_block5.txt", FileMode.Open); FileStream fs2 = new FileStream("../../created.txt", FileMode.Open); if (fs1.Length != fs2.Length) { fs1.Close(); fs2.Close(); Assert.IsTrue(false,"Incorrect file created - File lengths are different!"); return; } do { filebyte1 = fs1.ReadByte(); filebyte2 = fs2.ReadByte(); } while ((filebyte1 == filebyte2) && (filebyte1 != -1)); Assert.IsTrue((filebyte1 == filebyte2), "Newly created file and Original file does not match"); fs1.Close(); fs2.Close(); }
public void TestBlockSizefive() { FloorPlan image1 = new FloorPlan(new Bitmap("../../testImage.jpg"), 5); image1.printArray("../../testImage_block5.txt"); }