コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void copyShouldCopyExtremeValues()
        internal virtual void CopyShouldCopyExtremeValues()
        {
            // Given
            GenericKey extreme = NewKeyState();
            GenericKey copy    = NewKeyState();

            foreach (ValueGroup valueGroup in ValueGroup.values())
            {
                if (valueGroup != ValueGroup.NO_VALUE)
                {
                    extreme.InitValueAsLowest(valueGroup);
                    copy.CopyFrom(extreme);
                    assertEquals(0, extreme.CompareValueTo(copy), "states not equals after copy, valueGroup=" + valueGroup);
                    extreme.InitValueAsHighest(valueGroup);
                    copy.CopyFrom(extreme);
                    assertEquals(0, extreme.CompareValueTo(copy), "states not equals after copy, valueGroup=" + valueGroup);
                }
            }
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @MethodSource("validValueGenerators") void copyShouldCopy(ValueGenerator valueGenerator)
        internal virtual void CopyShouldCopy(ValueGenerator valueGenerator)
        {
            // Given
            GenericKey from  = NewKeyState();
            Value      value = valueGenerator();

            from.WriteValue(value, NEUTRAL);
            GenericKey to = GenericKeyStateWithSomePreviousState(valueGenerator);

            // When
            to.CopyFrom(from);

            // Then
            assertEquals(0, from.CompareValueTo(to), "states not equals after copy");
        }