public void GetIdentifierBasedOnIdentifierType_GivenSummaryAndEstablishmentNumberIdentifier_ReturnsEstablishmentNumberValue()
        {
            //Arrange
            ProviderSummary providerSummary = CreateProviderSummary();

            IdentifierFieldType identifierFieldType = IdentifierFieldType.EstablishmentNumber;

            //Act
            string identifierValue = providerSummary.GetIdentifierBasedOnIdentifierType(identifierFieldType);

            //Assert
            identifierValue
            .Should()
            .Be("444444");
        }
        public void GetIdentifierBasedOnIdentifierType_GivenSummaryAndLaCodeIdentifier_ReturnsLaCodeValue()
        {
            //Arrange
            ProviderSummary providerSummary = CreateProviderSummary();

            IdentifierFieldType identifierFieldType = IdentifierFieldType.LACode;

            //Act
            string identifierValue = providerSummary.GetIdentifierBasedOnIdentifierType(identifierFieldType);

            //Assert
            identifierValue
            .Should()
            .Be("111");
        }
        public void GetIdentifierBasedOnIdentifierType_GivenSummaryAndUpinIdentifier_ReturnsUpinValue()
        {
            //Arrange
            ProviderSummary providerSummary = CreateProviderSummary();

            IdentifierFieldType identifierFieldType = IdentifierFieldType.UPIN;

            //Act
            string identifierValue = providerSummary.GetIdentifierBasedOnIdentifierType(identifierFieldType);

            //Assert
            identifierValue
            .Should()
            .Be("1234");
        }
        public void GetIdentifierBasedOnIdentifierType_GivenSummaryAndNoneIdentifier_ThrowsArgumentOutOfRangeException()
        {
            //Arrange
            ProviderSummary providerSummary = CreateProviderSummary();

            IdentifierFieldType identifierFieldType = IdentifierFieldType.None;

            //Act
            Action test = () => providerSummary.GetIdentifierBasedOnIdentifierType(identifierFieldType);

            //Assert
            test
            .Should()
            .Throw <ArgumentOutOfRangeException>()
            .Which
            .Message
            .Should()
            .Be("Specified argument was out of the range of valid values. (Parameter 'identifierType was not one of the expected types')");
        }
Example #5
0
 private static Func <ProviderSummary, string> GetIdentifierSelectorExpression(IdentifierFieldType identifierFieldType)
 {
     if (identifierFieldType == IdentifierFieldType.URN)
     {
         return(x => x.URN);
     }
     else if (identifierFieldType == IdentifierFieldType.LACode)
     {
         return(x => x.LACode);
     }
     else if (identifierFieldType == IdentifierFieldType.EstablishmentNumber)
     {
         return(x => x.EstablishmentNumber);
     }
     else if (identifierFieldType == IdentifierFieldType.UKPRN)
     {
         return(x => x.UKPRN);
     }
     else if (identifierFieldType == IdentifierFieldType.UPIN)
     {
         return(x => x.UPIN);
     }
     else
     {
         return(null);
     }
 }
        public FieldDefinitionBuilder WithIdentifierFieldType(IdentifierFieldType identifierFieldType)
        {
            _identifierFieldType = identifierFieldType;

            return(this);
        }