// Path: src/main/java/com/marcospassos/phpserializer/FieldExclusionStrategy.java
// public interface FieldExclusionStrategy
// {
//     /**
//      * Checks whether the specified field should be ignored.
//      *
//      * @param field The field that is under test.
//      *
//      * @return {@code true} if the field should be ignored, or {@code false}
//      * otherwise.
//      */
//     boolean shouldSkipField(Field field);
// }


import java.lang.reflect.Field;
import com.marcospassos.phpserializer.FieldExclusionStrategy;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package com.marcospassos.phpserializer.exclusion;



/**
 * @author Marcos Passos
 * @since 1.0
 */
public class DisjunctionExclusionStrategyTest
{
    class A
    {
        private int field;
    }

    @Test
    public void shouldSkipFieldPerformsShortCircuitOrOperation()
        throws Exception
    {
        FieldExclusionStrategy a = mock(FieldExclusionStrategy.class);
        FieldExclusionStrategy b = mock(FieldExclusionStrategy.class);

        Field field = A.class.getDeclaredField("field");

        when(a.shouldSkipField(field)).thenReturn(true);

        FieldExclusionStrategy strategy = new DisjunctionExclusionStrategy(
            a,
            b
        );

        assertTrue(strategy.shouldSkipField(field));

// Path: src/main/java/com/marcospassos/phpserializer/FieldExclusionStrategy.java
// public interface FieldExclusionStrategy
// {
//     /**
//      * Checks whether the specified field should be ignored.
//      *
//      * @param field The field that is under test.
//      *
//      * @return {@code true} if the field should be ignored, or {@code false}
//      * otherwise.
//      */
//     boolean shouldSkipField(Field field);
// }


// Path: src/test/java/com/marcospassos/phpserializer/exclusion/DisjunctionExclusionStrategyTest.java
import java.lang.reflect.Field;
import com.marcospassos.phpserializer.FieldExclusionStrategy;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package com.marcospassos.phpserializer.exclusion;



/**
 * @author Marcos Passos
 * @since 1.0
 */
public class DisjunctionExclusionStrategyTest
{
    class A
    {
        private int field;
    }

    @Test
    public void shouldSkipFieldPerformsShortCircuitOrOperation()
        throws Exception
    {
        FieldExclusionStrategy a = mock(FieldExclusionStrategy.class);
        FieldExclusionStrategy b = mock(FieldExclusionStrategy.class);

        Field field = A.class.getDeclaredField("field");

        when(a.shouldSkipField(field)).thenReturn(true);

        FieldExclusionStrategy strategy = new DisjunctionExclusionStrategy(
            a,
            b
        );

        assertTrue(strategy.shouldSkipField(field));

        verify(a).shouldSkipField(field);