public void Click_method_thorws_exception() { var lightsGrid = TestHelper.Get5x5LightsGrid(LightStateType.Off); var mng = new LightsManager(null, null); var result = mng.Click(lightsGrid, 5, 5); }
public void Test_Click_method() { var lightsGrid = TestHelper.Get5x5LightsGrid(LightStateType.Off); var x = 4; var y = 4; var lightsHelper = new Mock <ILightsHelper>(); var lightsGridAfterClick = It.IsAny <LightsGrid>(); lightsHelper.Setup(h => h.Click(lightsGrid, x, y)).Returns(lightsGridAfterClick); var mng = new LightsManager(null, lightsHelper.Object); var result = mng.Click(lightsGrid, x, y); Assert.AreSame(result, lightsGridAfterClick); }