Exemple #1
0
        public HttpResponseMessage Register([FromBody] SubscriberRegisterRequestDto subscriberRegisterRequestDto)
        {
            registerSubscriber.Register(new SubscriberDetailDto
            {
                ListenerUrl = subscriberRegisterRequestDto.ListenerUrl
            });

            return(Request.CreateResponse(HttpStatusCode.OK, subscriberRegisterRequestDto.ListenerUrl));
        }
        public void Register_ShouldReturnItsValue()
        {
            var listenerUrl = "test";

            registerSubscriber.Register(new SubscriberDetailDto
            {
                ListenerUrl = listenerUrl
            });

            var count = subscriberRepository.GetAll().Count;

            Assert.Equal(1, count);

            var subscriberDetail = subscriberRepository.GetAll().First();

            Assert.Equal(listenerUrl, subscriberDetail.ListenerUrl);
        }