public void RealtimeSubscriptionServiceFindById() { using (var ctx = GetContextWithData()) { var service = new RealtimeSubscriptionService(ctx); var subscription = service.FindById(1); Assert.NotNull(subscription); Assert.Equal(1, subscription.Id); Assert.Equal("HL7", subscription.SourceMessageType); Assert.Equal("RAW", subscription.MessageFormat); Assert.True(subscription.IsActive); } }
public void RealtimeSubscriptionServiceAddSubscription() { var expected = new RealtimeSubscription { Name = "A", SourceMessageType = "HL7", MessageFormat = "RAW", RoutingKey = "HL7.{MessageType}.{EventType}" }; using (var ctx = CreateRealtimeContext()) { var service = new RealtimeSubscriptionService(ctx); service.Add(expected); var actual = service.FindById(expected.Id); Assert.NotNull(actual); Assert.True(actual.Id > 0); Assert.Equal("HL7", actual.SourceMessageType); Assert.Equal("RAW", actual.MessageFormat); Assert.True(actual.IsActive); } }