Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMap()
        public virtual void ShouldMap()
        {
            // given
            InstanceSelector <string> selector = SelectorFilledWithOrdinal();

            // when
            Dictionary <IndexSlot, int> actual = selector.Map(int?.parseInt);

            // then
            foreach (IndexSlot slot in Enum.GetValues(typeof(IndexSlot)))
            {
                assertEquals(( int )slot, actual[slot]);
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldThrowOnNonInstantiatedMap()
        public virtual void ShouldThrowOnNonInstantiatedMap()
        {
            // given
            InstanceSelector <string> selector = selector(NUMBER, "0");

            // when
            try
            {
                selector.Map(int?.parseInt);
                fail("Should have failed");
            }
            catch (System.InvalidOperationException)
            {
                // then
                // good
            }
        }