using Rhino.Mocks;
using Xunit;

namespace USD259.Test
{
    public class RepositoryBuildUpExample_1
    {
       [Fact]
        public void Fetch_A_Report_By_Id()
        {
            IReportRepository stubRepository =
                MockRepository.GenerateStub<IReportRepository>();

            Report stubReport =
                MockRepository.GenerateStub<Report>();

            stubReport.Id = 140;

            stubRepository
                .Expect(x => x.Get(140))
                .Return(stubReport);

            var report = stubRepository.Get(140);

            report.Id.ShouldBeEqualTo(140);
        }
    }
    
    // INHibernateRepository exists in our base library and is based on the
    // S#arp Architecture project.  Including the SharpArch.* libraries
    // should resolve the dependency.
    public interface IReportRepository : INHibernateRepository<Report>
    {
    }

    // PersistentObject exists in our base library and is based on the
    // S#arp Architecture project.  Including the SharpArch.* libraries
    // should resolve the dependency.
    public class Report : PersistentObject
    {
 
    }
}