Пример #1
0
        public async Task Index_SendsFindRequestIdByPhoneNumberQuery_WithCorrectPhoneNumber()
        {
            FindRequestIdByPhoneNumberQuery query = null;

            var mediatr = new Mock <IMediator>();

            mediatr.Setup(x => x.SendAsync(It.IsAny <FindRequestIdByPhoneNumberQuery>()))
            .ReturnsAsync(Guid.Empty)
            .Callback <FindRequestIdByPhoneNumberQuery>(x => query = x)
            .Verifiable();

            var sut    = new SmsResponseController(mediatr.Object, null);
            var result = await sut.Index(GoodPhoneNumber, It.IsAny <string>());

            query.PhoneNumber.ShouldBe(GoodPhoneNumber);
        }
        public void Ctor_SetsPhoneNumber()
        {
            var sut = new FindRequestIdByPhoneNumberQuery(GoodPhoneNumber);

            sut.PhoneNumber.ShouldBe(GoodPhoneNumber);
        }