public void CanGenerateHashForMessage() { // ARRANGE var hashRequest = Substitute.For <HashRequest>(); var expectedHashRespone = Substitute.For <HashResponse>(); _cryptographer.GenerateHash(hashRequest).Returns(expectedHashRespone); // ACT var result = _subjectUnderTest.Post(hashRequest); // ASSERT Assert.That(result, Is.Not.Null); _cryptographer.Received(1).GenerateHash(hashRequest); }