public void TestThatGetFrameInFrameBIlderReturnedValueWithClassicPatternFrameBuilder()
 {
     TileFactory tileFactory = new LetterTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var actualFrame = frameDirector.ConstructFrame(0, 0);
     Assert.IsNotNull(actualFrame);
 }
 public void TestThatGetFrameInFrameBIlderCorectFrameWithClassicPatternFrameBuilderGreatFrameDimensionMin()
 {
     TileFactory tileFactory = new LetterTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var actualFrame = frameDirector.ConstructFrame(5, 5);
     Assert.IsInstanceOfType(actualFrame, typeof(IFrame));
 }
 public void ExpectDoNotCatchExaptionsTestGetHeshCodeMetothdInProxyFrame()
 {
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var expectetFrame = frameDirector.ConstructFrame(5, 5);
     var proxyFrame = new ProxyFrame(expectetFrame);
     var hash = proxyFrame.GetHashCode();
 }
 public void TestThatGetFrameInFrameBIlderCorectFrameWithClassicPatternFrameBuilderClone()
 {
     TileFactory tileFactory = new LetterTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var expectetFrame = frameDirector.ConstructFrame(5, 5);
     var actualsFrame = expectetFrame.Clone();
     Assert.AreEqual(expectetFrame, actualsFrame);
 }
 public void ExpectTrueEqualsMethodWhithNullIframeTest()
 {
     TileFactory tileFactoryFirst = new NumberTileFactory();
     FrameBuilder frameBuilderFirst = new ClassicPatternFrameBuilder(tileFactoryFirst);
     var frameDirectorFirst = new FrameDirector(frameBuilderFirst);
     var expectetFrameFirst = frameDirectorFirst.ConstructFrame(5, 5);
     IFrame expectetFrameSecond = null;
     bool result = expectetFrameFirst.Equals(expectetFrameSecond);
     Assert.IsFalse(result);
 }
 public void TestToStringMetothdInProxyFrameDoNotHandleExeptions()
 {
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var expectetFrame = frameDirector.ConstructFrame(5, 5);
     var proxyFrame = new ProxyFrame(expectetFrame);
     string expectedresult = "-----------------\r\n|  1  2  3  4  5|\r\n|  6  7  8  9 10|\r\n| 11 12 13 14 15|\r\n| 16 17 18 19 20|\r\n| 21 22 23 24   |\r\n-----------------";
     string actualsresult = proxyFrame.ToString();
     Assert.AreEqual(expectedresult, actualsresult);
 }
 public void TestMoverIsMovingATileWhichCanBeMovedByLeftAllRowRowColMover()
 {
     var mover = new RowColMover();
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var initialFrame = frameDirector.ConstructFrame(4, 4);
     var actualFrame = initialFrame.Clone();
     bool moveLeft = mover.Move("13", actualFrame);
     Assert.IsTrue(moveLeft, "Mover method should return true when the tile can be moved");
     Assert.AreNotEqual(initialFrame, actualFrame, "The frame should be changed when the mover moves the tile");
 }
 public void ExpectDoNotCatchExaptionsTestEqualsMethodtInProxyFrame()
 {
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var expectetFrame = frameDirector.ConstructFrame(5, 5);
     var proxyFrame = new ProxyFrame(expectetFrame);
     var proxyOne = new ProxyFrame(proxyFrame);
     var proxyTwo = proxyOne;
     var result = proxyOne.Equals(proxyTwo);
     Assert.IsTrue(result);
 }
 public void TestMoverNotMovingATileWhichCanNotBeMoved()
 {
     var mover = new ClassicMover();
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var initialFrame = frameDirector.ConstructFrame(4, 4);
     var actualFrame = initialFrame.Clone();
     bool result = mover.Move("14", actualFrame);
     Assert.IsFalse(result, "Mover method should return false when the tile can not be moved");
     Assert.AreEqual(initialFrame, actualFrame, "The frame should not be changed");
 }
 public void ExpectFalseEqualsMethodWhithDiferentIframeWithDiferentSizeOfColumnsTest()
 {
     TileFactory tileFactoryFirst = new NumberTileFactory();
     TileFactory tileFactorySecond = new NumberTileFactory();
     FrameBuilder frameBuilderFirst = new ClassicPatternFrameBuilder(tileFactoryFirst);
     FrameBuilder frameBuilderSecond = new ColumnsPatternFrameBuilder(tileFactorySecond);
     var frameDirectorFirst = new FrameDirector(frameBuilderFirst);
     var frameDirectorSecond = new FrameDirector(frameBuilderSecond);
     var expectetFrameFirst = frameDirectorFirst.ConstructFrame(5, 5);
     var expectetFrameSecond = frameDirectorSecond.ConstructFrame(6, 6);
     bool result = expectetFrameFirst.Equals(expectetFrameSecond);
     Assert.IsFalse(result);
 }
 public void TestShuffleIsMovingATileWhichCanBeMovedByColumnRowColMover()
 {
     var mover = new RowColMover();
     TileFactory tileFactory = new NumberTileFactory();
     FrameBuilder frameBuilder = new ClassicPatternFrameBuilder(tileFactory);
     var frameDirector = new FrameDirector(frameBuilder);
     var initialFrame = frameDirector.ConstructFrame(4, 4);
     var actualFrame = initialFrame.Clone();
     mover.Shuffle(actualFrame);
     Assert.AreNotEqual(initialFrame, actualFrame, "The frame should be changed when shuffled");
 }