コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSelect()
        public virtual void ShouldSelect()
        {
            // given
            InstanceSelector <string> selector = selector(NUMBER, "0", STRING, "1");

            // when
            string select0 = selector.Select(NUMBER);

            // then
            assertEquals("0", select0);

            // when
            string select1 = selector.Select(STRING);

            // then
            assertEquals("1", select1);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldThrowOnNonInstantiatedSelect()
        public virtual void ShouldThrowOnNonInstantiatedSelect()
        {
            // given
            InstanceSelector <string> selector = selector(NUMBER, "0");

            try
            {
                // when
                selector.Select(STRING);
                fail("Should have failed");
            }
            catch (System.InvalidOperationException)
            {
                // then
                // good
            }
        }