Package net.thucydides.core.model.features

Examples of net.thucydides.core.model.features.ApplicationFeature


    @Test
    public void a_user_story_does_not_have_to_belong_to_a_feature() {
        Class<?> userStoryClass = SimpleTestCase.class;

        net.thucydides.core.model.Story story = net.thucydides.core.model.Story.from(userStoryClass);
        ApplicationFeature feature = story.getFeature();
        assertThat(feature, is(nullValue()));
    }
View Full Code Here


        assertThat(feature, is(nullValue()));
    }

    @Test
    public void a_feature_can_be_defined_by_providing_a_feature_class() {
        ApplicationFeature feature = ApplicationFeature.from(WidgetFeature.class);

        assertThat(feature.getId(), is(WidgetFeature.class.getCanonicalName()));
        assertThat(feature.getName(), is("Widget feature"));
    }
View Full Code Here

        assertThat(feature.getName(), is("Widget feature"));
    }

    @Test
    public void a_feature_can_also_be_defined_by_providing_the_class_path_and_name() {
        ApplicationFeature feature = new ApplicationFeature(WidgetFeature.class.getCanonicalName(), "Widget feature");

        assertThat(feature.getId(), is(WidgetFeature.class.getCanonicalName()));
        assertThat(feature.getName(), is("Widget feature"));
    }
View Full Code Here

        assertThat(feature.getName(), is("Widget feature"));
    }

    @Test
    public void the_feature_name_is_by_default_the_human_readable_form_of_the_feature_class() {
        ApplicationFeature feature = ApplicationFeature.from(WidgetFeature.class);
        assertThat(feature.getName(), is("Widget feature"));
    }
View Full Code Here

        assertThat(feature.getName(), is("Widget feature"));
    }

    @Test
    public void the_feature_name_can_be_ovverriden() {
        ApplicationFeature feature = new ApplicationFeature(WidgetFeature.class.getCanonicalName(), "My special widget feature");
        assertThat(feature.getName(), is("My special widget feature"));
    }
View Full Code Here

        assertThat(story.getFeature().getName(), is("Widget feature"));
    }

    @Test
    public void a_feature_is_equal_to_itself() {
        ApplicationFeature feature = ApplicationFeature.from(WidgetFeature.class);
        assertThat(feature.equals(feature), is(true));
    }
View Full Code Here

        }
    };

    @Test
    public void a_feature_can_be_equal_to_another_subclassed_feature_instance() {
        ApplicationFeature feature = ApplicationFeature.from(WidgetFeature.class);
        SubvertedFeature subvertedFeature = new SubvertedFeature(WidgetFeature.class);
        assertThat(feature.equals(subvertedFeature), is(true));
    }
View Full Code Here

        assertThat(feature.equals(subvertedFeature), is(true));
    }

    @Test
    public void a_feature_can_only_be_equal_to_another_feature_instance() {
        ApplicationFeature feature = ApplicationFeature.from(WidgetFeature.class);
        Object notAFeature = new Object();
        assertThat(feature.equals(notAFeature), is(false));
    }
View Full Code Here

        assertThat(feature.equals(notAFeature), is(false));
    }

    @Test
    public void features_referring_to_the_same_feature_class_are_identical() {
        ApplicationFeature feature1 = ApplicationFeature.from(WidgetFeature.class);
        ApplicationFeature feature2 = ApplicationFeature.from(WidgetFeature.class);

        assertThat(feature1, is(feature2));
        assertThat(feature1.hashCode(), is(feature2.hashCode()));
    }
View Full Code Here

        assertThat(feature1.hashCode(), is(feature2.hashCode()));
    }

    @Test
    public void features_referring_to_different_feature_classes_are_different() {
        ApplicationFeature feature1 = ApplicationFeature.from(WidgetFeature.class);
        ApplicationFeature feature2 = ApplicationFeature.from(GizmoFeature.class);

        assertThat(feature1, is(not(feature2)));
        assertThat(feature1.hashCode(), is(not(feature2.hashCode())));
    }
View Full Code Here

TOP

Related Classes of net.thucydides.core.model.features.ApplicationFeature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.