public void ReelsController_ShouldCallGetReelByIdMethod_AndReturnResultById() { _mockService.Setup(x => x.GetReelById(10)).Returns(new Reel { ReelId = 10 }); _reelsController = new ReelController(); _reelsController.MockService = _mockService.Object; var result = _reelsController.GetReelById(10); _mockService.Verify(m => m.GetReelById(10), Times.Once); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(Reel)); }
ReelController reelController;//Reelcontrollerの宣言 private void Awake() { reelController = GameObject.Find("ReelController").GetComponent <ReelController>();//Reelcontrollerの取得 }
public void TestInitialize() { _mockService = new Mock <IReelService>(); _reelsController = new ReelController(); _reelsController.MockService = _mockService.Object; }
void Awake() { _instance = this; }