public void ShouldChangeShareType() { // Arrange this.shareTableRepository = Substitute.For <IShareTableRepository>(); int testShareId = 55; this.shareTableRepository.ContainsById(Arg.Is(testShareId)).Returns(true); SharesService sharesService = new SharesService(this.shareTableRepository); // Act sharesService.ChangeType(testShareId, this.type); // Assert this.shareTableRepository.Received(1).SetType(testShareId, this.type); this.shareTableRepository.Received(1).SaveChanges(); }