Exemple #1
0
        public void FindByUniqueIdentifier()
        {
            IUsaStateDefinitionFinder testItem  = new UsaStateDefinitionFinder(this.GetDefaultIUsaStateDefinitionConfigurationRetrieverMock().Object);
            UsaStateObject            foundItem = testItem.FindUsaStateObjectByUniqueId(VirginiaUsaStateDefinitionUniqueIdentifier);

            Assert.IsNotNull(foundItem);
            Assert.AreEqual(VirginiaUsaStateDefinitionUniqueIdentifier, foundItem.UsaStateDefinitionUniqueIdentifier);
            Assert.AreEqual(VirginiaUsaStateAbbreviation, foundItem.UsaStateAbbreviation);
            Assert.AreEqual(VirginiaUsaStateFullName, foundItem.UsaStateFullName);
        }
Exemple #2
0
        public void UsaStateDefinitionsIsNullByUniqueIdentifierTest()
        {
            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.FindUsaStateObjectByUniqueId(0);

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

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

            testTriggerItem.UsaStateDefinitionUniqueIdentifier = NorthCarolinaUsaStateDefinitionUniqueIdentifier;
            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.FindUsaStateObjectByUniqueId(NorthCarolinaUsaStateDefinitionUniqueIdentifier);
        }