public void ShouldThrowExceptionIfCantFindShare() { // Arrange this.shareTableRepository = Substitute.For <IShareTableRepository>(); int testId = 55; this.shareTableRepository.ContainsById(Arg.Is(testId)).Returns(false); // Now Contains returns false (table don't contains share type with this Id) SharesService sharesService = new SharesService(this.shareTableRepository); // Act sharesService.ContainsById(testId); // Try to get share type and get exception // Assert }