public async Task Task_GetRoutingRuleById_Return_NotFoudResult()
        {
            //Arrange
            SetValues();

            RoutingRulesById obj = new RoutingRulesById();

            obj = null;

            routingBusiness.Setup(x => x.GetByID(It.IsAny <Guid>())).Returns(obj);

            //Act
            var mockresponse = await controller.GetRoutingRule();

            //Assert
            Assert.IsType <BadRequestObjectResult>(mockresponse);
        }
Beispiel #2
0
        private void SendEvent(RoutingRulesById routingRulesById, string type, Dictionary <string, string> headers)
        {
            var eventMessage = new RoutingRuleEvent
            {
                Message   = routingRulesById,
                EventType = type
            };

            try
            {
                _eventBus.Publish(_configuration.RoutingRule, eventMessage, headers);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
            }
        }
        private RoutingRulesById FakeDataTorGetRoutingRuleById()
        {
            var result = new RoutingRulesById()
            {
                RoutingRuleKey          = Utility.GetNewGuid(),
                RoutingRuleName         = "Test",
                RoutingRuleDestinations = new List <Guid> {
                    new Guid()
                },
                RoutingRuleScheduleTimings = new List <Guid> {
                    new Guid()
                },
                RoutingRuleTranPriorities = new List <Guid> {
                    new Guid()
                }
            };

            return(result);
        }