public void RoundTrip_3_3_Identity() { var stringMatrix = @"1 0 0 0 1 0 0 0 1"; var roundTrip = BoolMatrix.Parse(stringMatrix).ToString(); Assert.AreEqual(stringMatrix, roundTrip); }
public void Size2Square_BottomRight_3_3() { var stringMatrix = @" 0 0 0 0 1 1 0 1 1".Trim(); var result = GetResult(BoolMatrix.Parse(stringMatrix)); Assert.AreEqual(2, result.Size); Assert.AreEqual(1, result.StartX); Assert.AreEqual(1, result.StartY); }
public void Size2Square_TopLeft_3_3() { var stringMatrix = @" 1 1 0 1 1 0 0 0 0".Trim(); var result = GetResult(BoolMatrix.Parse(stringMatrix)); Assert.AreEqual(2, result.Size); Assert.AreEqual(0, result.StartX); Assert.AreEqual(0, result.StartY); }
public void Size1Square_3_3() { var stringMatrix = @" 0 0 0 0 1 0 0 0 0".Trim(); var result = GetResult(BoolMatrix.Parse(stringMatrix)); Assert.AreEqual(1, result.Size); Assert.AreEqual(1, result.StartX); Assert.AreEqual(1, result.StartY); }
public void Size4Square_8_8() { var stringMatrix = @" 1 1 1 1 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 ".Trim(); var result = GetResult(BoolMatrix.Parse(stringMatrix)); Assert.AreEqual(4, result.Size); Assert.AreEqual(3, result.StartX); Assert.AreEqual(4, result.StartY); }