Beispiel #1
0
 public void TestCanvasCreatesLayerCorrectly()
 {
     screen = MockRepository.GenerateMock<Screen>();
     var canvas = new Canvas(screen);
     var layerId = canvas.CreateLayer();
     var layer = canvas.GetLayer(layerId);
     Assert.That(layer, Is.Not.Null);
 }
Beispiel #2
0
 public void TestCanvasDrawsPointCorrectly()
 {
     screen = MockRepository.GenerateStub<Screen>();
     var canvas = new Canvas(screen);
     var layerId = canvas.CreateLayer();
     var layer = canvas.GetLayer(layerId);
     layer.DrawPoint(20, 20, Colour.LightBlue);
     screen.Expect(s => s.DrawPoint(20, 20, Colour.LightBlue)).Repeat.Once();
     canvas.Redraw();
     screen.VerifyAllExpectations();
 }