Beispiel #1
0
        public void ValidateSubscriberAndProvider_WhenSubscriberDataIsIncorrect_ShouldReturnSubscriberNotFoundStatus()
        {
            // Arrange
            var dialogServiceMock = new Mock <IDialogService>();
            var api = new ChewsiApi(dialogServiceMock.Object);
            ProviderInformation   provider   = GetValidProvider();
            SubscriberInformation subscriber = GetValidSubscriber();

            subscriber.Id = "123456"; // API checks First Name and Chewsi Id
            ProviderAddressInformation providerAddress = GetValidProviderAddress();

            // Act
            ValidateSubscriberAndProviderResponse response = api.ValidateSubscriberAndProvider(provider, providerAddress, subscriber);

            // Assert
            // Validate provider
            Assert.AreEqual("4074437", response.ProviderID);
            Assert.IsNull(response.ProviderValidationMessage);
            Assert.AreEqual("Valid", response.ProviderValidationStatus);
            // Validate subscriber
            Assert.IsNull(response.SubscriberID);
            Assert.AreEqual("Please validate that the subscriber's Chewsi ID and First Name match the information shown before proceeding. If the information does not match, the Chewsi ID may have been keyed into the practice management system incorrectly. Please ask the subscriber for their Chewsi ID to validate.",
                            response.SubscriberValidationMessage);
            Assert.AreEqual("Subscriber Not Found", response.SubscriberValidationStatus);
            Assert.AreEqual("1", response.OfficeNumber);

            Assert.AreEqual(false, response.ValidationPassed);
        }
Beispiel #2
0
        public void ValidateSubscriberAndProvider_ShouldReturnValidStatus()
        {
            // Arrange
            var dialogServiceMock = new Mock <IDialogService>();
            var api = new ChewsiApi(dialogServiceMock.Object);
            ProviderInformation        provider        = GetValidProvider();
            SubscriberInformation      subscriber      = GetValidSubscriber();
            ProviderAddressInformation providerAddress = GetValidProviderAddress();

            // Act
            ValidateSubscriberAndProviderResponse response = api.ValidateSubscriberAndProvider(provider, providerAddress, subscriber);

            // Assert
            // Validate provider
            Assert.IsNotNull(response.ProviderID);
            Assert.IsNull(response.ProviderValidationMessage);
            Assert.AreEqual("Valid", response.ProviderValidationStatus);
            // Validate subscriber
            Assert.AreEqual("4", response.SubscriberID);
            Assert.IsNull(response.SubscriberValidationMessage);
            Assert.AreEqual("Valid", response.SubscriberValidationStatus);
            Assert.AreEqual("1", response.OfficeNumber);

            Assert.AreEqual(true, response.ValidationPassed);
        }
Beispiel #3
0
        public void ValidateSubscriberAndProvider_WhenProviderDataIsIncorrect_ShouldReturnProviderNotFoundStatus()
        {
            // Arrange
            var dialogServiceMock = new Mock <IDialogService>();
            var api = new ChewsiApi(dialogServiceMock.Object);
            ProviderInformation        provider        = GetValidProvider();
            SubscriberInformation      subscriber      = GetValidSubscriber();
            ProviderAddressInformation providerAddress = GetValidProviderAddress();

            providerAddress.RenderingAddress1 += " test";

            // Act
            ValidateSubscriberAndProviderResponse response = api.ValidateSubscriberAndProvider(provider, providerAddress, subscriber);

            // Assert
            // Validate provider
            Assert.IsNull(response.ProviderID);
            Assert.AreEqual("We did not find the provider for which this claim is being submitted for in the list of Chewsi registered providers. Please validate that the claim is being submitted under a provider who has already registered themselves under the Chewsi network.",
                            response.ProviderValidationMessage);
            Assert.AreEqual("Provider Not Found", response.ProviderValidationStatus);
            // Validate subscriber
            Assert.AreEqual("4", response.SubscriberID);
            Assert.IsNull(response.SubscriberValidationMessage);
            Assert.AreEqual("Valid", response.SubscriberValidationStatus);

            //TODO
            Assert.AreEqual("", response.OfficeNumber);

            Assert.AreEqual(false, response.ValidationPassed);
        }