Exemple #1
0
        public void FindByFullStateName()
        {
            IUsaStateDefinitionFinder testItem  = new UsaStateDefinitionFinder(this.GetDefaultIUsaStateDefinitionConfigurationRetrieverMock().Object);
            UsaStateObject            foundItem = testItem.FindUsaStateObject(VirginiaUsaStateFullName);

            Assert.IsNotNull(foundItem);
            Assert.AreEqual(VirginiaUsaStateDefinitionUniqueIdentifier, foundItem.UsaStateDefinitionUniqueIdentifier);
            Assert.AreEqual(VirginiaUsaStateAbbreviation, foundItem.UsaStateAbbreviation);
            Assert.AreEqual(VirginiaUsaStateFullName, foundItem.UsaStateFullName);
        }
Exemple #2
0
        public void UsaStateDefinitionsIsNullByFullNameTest()
        {
            UsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter configurationWrapper = new UsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter();

            configurationWrapper.UsaStateDefinitions = null;

            Mock <IUsaStateDefinitionConfigurationRetriever> mockRetriever = this.GetDefaultIUsaStateDefinitionConfigurationRetrieverMock();

            mockRetriever.Setup(x => x.GetUsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter()).Returns(configurationWrapper);
            IUsaStateDefinitionFinder testItem  = new UsaStateDefinitionFinder(mockRetriever.Object);
            UsaStateObject            foundItem = testItem.FindUsaStateObject(DummyValue);

            Assert.IsNull(foundItem);
        }
Exemple #3
0
        public void DuplicateByFullNameTest()
        {
            UsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter configurationWrapper = new UsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter();

            configurationWrapper.UsaStateDefinitions.Add(this.GetNorthCarolina());
            UsaStateObject testTriggerItem = this.GetVirginia();

            testTriggerItem.UsaStateFullName = NorthCarolinaUsaStateFullName;
            configurationWrapper.UsaStateDefinitions.Add(testTriggerItem);
            configurationWrapper.UsaStateDefinitions.Add(testTriggerItem);

            Mock <IUsaStateDefinitionConfigurationRetriever> mockRetriever = this.GetDefaultIUsaStateDefinitionConfigurationRetrieverMock();

            mockRetriever.Setup(x => x.GetUsaStateConfigurationWrapperThisObjectNameDoesNotReallyMatter()).Returns(configurationWrapper);
            IUsaStateDefinitionFinder testItem = new UsaStateDefinitionFinder(mockRetriever.Object);

            testItem.FindUsaStateObject(NorthCarolinaUsaStateFullName);
        }