Ejemplo n.º 1
0
        public async void Handle_WhenLeftPayLoadIsNotFound_ShouldReturnFalse(AnalyzeDiffCommand command, byte[] content)
        {
            var payLoads = new List <PayLoad>
            {
                new PayLoad(command.CorrelationId, content, SideEnum.Right)
            };

            _payLoadRepository.GetByCorrelationId(command.CorrelationId).Returns(payLoads);

            var result = await _sut.Handle(command, new CancellationToken());

            result.Should().BeFalse();
        }
Ejemplo n.º 2
0
        public async System.Threading.Tasks.Task Should_return_that_jsons_are_equalAsync()
        {
            _differResult.Setup(d => d.AreEqual).Returns(true);
            _differResult.Setup(d => d.Id).Returns(_id);
            _differ.Setup(d => d.Diff()).Returns(_differResult.Object);
            _repostirory.Setup(r => r.GetById(It.Is <string>(i => i == _id))).Returns(_differ.Object);
            var handler = new DiffCommandHandler(_repostirory.Object);
            var result  = await handler.Handle(new DiffCommand(_id), default(CancellationToken));

            Assert.True(result.AreEqual);
        }