using FluentNHibernate.MappingModel.ClassBased;
using FluentNHibernate.Specs.FluentInterface.Fixtures;
using Machine.Specifications;

namespace FluentNHibernate.Specs.FluentInterface.SubclassMapSpecs
{
    public class when_subclass_map_is_told_to_map_a_has_one : ProviderSpec
    {
        Because of = () =>
            mapping = map_as_subclass<EntityWithReferences>(m => m.HasOne(x => x.Reference));

        Behaves_like<ClasslikeHasOneBehaviour> a_has_one_in_a_classlike_mapping;

        protected static SubclassMapping mapping;
    }

    public class when_subclass_map_is_told_to_map_a_has_one_using_reveal : ProviderSpec
    {
        Because of = () =>
            mapping = map_as_subclass<EntityWithReferences>(m => m.HasOne(Reveal.Member<EntityWithReferences>("Reference")));

        Behaves_like<ClasslikeHasOneBehaviour> a_has_one_in_a_classlike_mapping;

        protected static SubclassMapping mapping;
    }
}