Пример #1
0
        /// <summary>
        /// This is a future-proofing test. If you come here because you've made changes to the serialization format,
        /// this is your reminder to make sure to build this is in a backwards compatible way.
        /// </summary>
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReadV1SerializationFormat() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldReadV1SerializationFormat()
        {
            // Given
            RoleSerialization serialization = new RoleSerialization();

            // When
            IList <RoleRecord> deserialized = serialization.DeserializeRecords(UTF8.encode("admin:Bob,Steve\n" + "publisher:Kelly,Marie\n"));

            // Then
            assertThat(deserialized, equalTo(asList(new RoleRecord("admin", _steveBob), new RoleRecord("publisher", _kellyMarie))));
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSerializeAndDeserialize() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSerializeAndDeserialize()
        {
            // Given
            RoleSerialization serialization = new RoleSerialization();

            IList <RoleRecord> roles = asList(new RoleRecord("admin", _steveBob), new RoleRecord("publisher", _kellyMarie));

            // When
            sbyte[] serialized = serialization.Serialize(roles);

            // Then
            assertThat(serialization.DeserializeRecords(serialized), equalTo(roles));
        }