コード例 #1
0
        public void SetUp()
        {
            loaderMock        = new DynamicMock(typeof(ILoadImageModel));
            loaderMock.Strict = true;
            loader            = loaderMock.MockInstance as ILoadImageModel;

            cutterMock        = new DynamicMock(typeof(IImageCutter));
            cutterMock.Strict = true;
            cutter            = cutterMock.MockInstance as IImageCutter;

            model = new PuzzleModel(loader, cutter);

            updateFred = new Fred();
            model.SubscribeUpdateImages(new EventDelegate(updateFred.Update));
            AssertFredUpdates(updateFred, 0);

            piece0 = new Bitmap(1, 1);
            piece1 = new Bitmap(1, 1);
            piece2 = new Bitmap(1, 1);
            piece3 = new Bitmap(1, 1);
            piece4 = new Bitmap(1, 1);
            piece5 = new Bitmap(1, 1);
            piece6 = new Bitmap(1, 1);
            piece7 = new Bitmap(1, 1);
            piece8 = new Bitmap(1, 1);

            pieces = new Image[][]
            {
                new Image[] { piece0, piece1, piece2 },
                new Image[] { piece3, piece4, piece5 },
                new Image[] { piece6, piece7, piece8 }
            };
        }
コード例 #2
0
 public PuzzleModel(ILoadImageModel imageLoader, IImageCutter imageCutter)
 {
     m_imageCutter = imageCutter;
     m_imageLoader = imageLoader;
 }