Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNoteDeprecatedFields() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNoteDeprecatedFields()
        {
            // when
            OutputMapper mapper = mapper(typeof(RecordWithDeprecatedFields));

            // then
            assertThat(mapper.Signature(), containsInAnyOrder(outputField("deprecated", NTString, true), outputField("alsoDeprecated", NTString, true), outputField("replacement", NTString, false)));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMapSimpleRecordWithString() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMapSimpleRecordWithString()
        {
            // When
            OutputMapper mapper = mapper(typeof(SingleStringFieldRecord));

            // Then
            assertThat(mapper.Signature(), contains(outputField("name", NTString)));
            assertThat(asList(mapper.Apply(new SingleStringFieldRecord("hello, world!"))), contains("hello, world!"));
        }
Example #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSkipStaticFields() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSkipStaticFields()
        {
            // When
            OutputMapper mapper = mapper(typeof(RecordWithStaticFields));

            // Then
            assertThat(mapper.Signature(), contains(outputField("includeMe", NTString)));
            assertThat(asList(mapper.Apply(new RecordWithStaticFields("hello, world!"))), contains("hello, world!"));
        }