Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void canOverwriteFunctionAndChangeCaseSensitivity()
        public virtual void CanOverwriteFunctionAndChangeCaseSensitivity()
        {
            // given
            ProcedureHolder <string> procHolder    = new ProcedureHolder <string>();
            QualifiedName            qualifiedName = new QualifiedName(new string[0], "CaseInSensitive");
            string item = "CaseInSensitiveItem";

            procHolder.Put(qualifiedName, item, true);

            // then
            QualifiedName lowerCaseName = new QualifiedName(new string[0], "caseinsensitive");

            assertThat(procHolder.Get(lowerCaseName), equalTo(item));
            assertThat(procHolder.IdOf(lowerCaseName), equalTo(0));

            // and then
            procHolder.Put(qualifiedName, item, false);
            assertNull(procHolder.Get(lowerCaseName));
            try
            {
                procHolder.IdOf(lowerCaseName);
                fail("Should have failed to find with lower case");
            }
            catch (NoSuchElementException)
            {
                // expected
            }
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetProcedureFromHolder()
        public virtual void ShouldGetProcedureFromHolder()
        {
            // given
            ProcedureHolder <string> procHolder    = new ProcedureHolder <string>();
            QualifiedName            qualifiedName = new QualifiedName(new string[0], "CaseSensitive");
            string item = "CaseSensitiveItem";

            procHolder.Put(qualifiedName, item, false);

            // then
            assertThat(procHolder.Get(qualifiedName), equalTo(item));
            assertThat(procHolder.IdOf(qualifiedName), equalTo(0));
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void okToHaveProcsOnlyDifferByCase()
        public virtual void OkToHaveProcsOnlyDifferByCase()
        {
            // given
            ProcedureHolder <string> procHolder = new ProcedureHolder <string>();

            procHolder.Put(new QualifiedName(new string[0], "CASESENSITIVE"), "CASESENSITIVEItem", false);
            procHolder.Put(new QualifiedName(new string[0], "CaseSensitive"), "CaseSensitiveItem", false);

            // then
            assertThat(procHolder.Get(new QualifiedName(new string[0], "CASESENSITIVE")), equalTo("CASESENSITIVEItem"));
            assertThat(procHolder.Get(new QualifiedName(new string[0], "CaseSensitive")), equalTo("CaseSensitiveItem"));
            assertThat(procHolder.IdOf(new QualifiedName(new string[0], "CASESENSITIVE")), equalTo(0));
            assertThat(procHolder.IdOf(new QualifiedName(new string[0], "CaseSensitive")), equalTo(1));
        }
Esempio n. 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldGetCaseInsensitiveFromHolder()
        public virtual void ShouldGetCaseInsensitiveFromHolder()
        {
            // given
            ProcedureHolder <string> procHolder    = new ProcedureHolder <string>();
            QualifiedName            qualifiedName = new QualifiedName(new string[0], "CaseInSensitive");
            string item = "CaseInSensitiveItem";

            procHolder.Put(qualifiedName, item, true);

            // then
            QualifiedName lowerCaseName = new QualifiedName(new string[0], "caseinsensitive");

            assertThat(procHolder.Get(lowerCaseName), equalTo(item));
            assertThat(procHolder.IdOf(lowerCaseName), equalTo(0));
        }