예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void toggleShouldDecay()
        internal virtual void ToggleShouldDecay()
        {
            // Given
            DecayingFlags.Key featureA = new DecayingFlags.Key(1);
            DecayingFlags.Key featureB = new DecayingFlags.Key(3);
            DecayingFlags     set      = new DecayingFlags(2);

            // And given Feature A has been used quite a bit, while
            // feature B is not quite as popular..
            set.Flag(featureA);
            set.Flag(featureA);
            set.Flag(featureB);

            // When
            set.Sweep();

            // Then
            assertEquals("4000", set.AsHex());

            // When
            set.Sweep();

            // Then
            assertEquals("0000", set.AsHex());
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldTrackToggle()
        internal virtual void ShouldTrackToggle()
        {
            // Given
            DecayingFlags.Key myFeature = new DecayingFlags.Key(1);
            DecayingFlags     set       = new DecayingFlags(1);

            // When
            set.Flag(myFeature);

            // Then
            assertEquals("4000", set.AsHex());
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldTrackMultipleFlags()
        internal virtual void ShouldTrackMultipleFlags()
        {
            // Given
            DecayingFlags.Key featureA = new DecayingFlags.Key(1);
            DecayingFlags.Key featureB = new DecayingFlags.Key(3);
            DecayingFlags     set      = new DecayingFlags(2);

            // When
            set.Flag(featureA);
            set.Flag(featureA);
            set.Flag(featureB);

            // Then
            assertEquals("5000", set.AsHex());
        }
예제 #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void resetFlagShouldRecoverIfToggledAgain()
        internal virtual void ResetFlagShouldRecoverIfToggledAgain()
        {
            // Given
            DecayingFlags.Key featureA = new DecayingFlags.Key(9);
            DecayingFlags     set      = new DecayingFlags(2);

            set.Flag(featureA);

            // When
            set.Sweep();

            // Then
            assertEquals("0000", set.AsHex());

            // When
            set.Flag(featureA);

            // Then
            assertEquals("0040", set.AsHex());
        }