Пример #1
0
        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);
        }
Пример #2
0
        public IActionResult Post([FromBody] HashRequest hashRequest)
        {
            var hashResponse = _cryptographer.GenerateHash(hashRequest);

            return(Ok(hashResponse));
        }