public void When()
        {
            Setup();

            DistributionPartnerContractsParser
            .Setup(x => x.Parse(It.IsAny <string>()))
            .Returns(new[]
            {
                DistributedPartnerContractBuilder.Build.WithPartner("Itunes").WithUsage("stream").AnInstance(),
                DistributedPartnerContractBuilder.Build.WithPartner("Another").WithUsage("downloads").AnInstance(),
                DistributedPartnerContractBuilder.Build.WithPartner("AnotherOther").WithUsage("videos").AnInstance()
            });

            MusicContractsParser
            .Setup(x => x.Parse(It.IsAny <string>()))
            .Returns(new[]
            {
                new MusicContract()
                {
                    Usages    = new[] { "stream", "download" },
                    Artist    = "artist",
                    EndDate   = new DateTime(2001, 1, 1),
                    StartDate = new DateTime(2000, 6, 1),
                    Title     = "title"
                }
            });

            _result = DataAccess.Query("Itunes", new DateTime(1970, 01, 01));
        }
        public void Setup()
        {
            FileLoader = new Mock <IFileLoader>();

            MusicContractsParser = new MusicContractsParser(
                FileLoader.Object);
        }
Beispiel #3
0
        public void When()
        {
            Setup();
            _filename = "filename";

            FileLoader
            .Setup(x => x.Fetch(_filename))
            .Returns(
                @"Artist|Title|Usages|StartDate|EndDate
Tinie Tempah|Frisky (Live from SoHo)|digital download, streaming|1st Feb 2012|
Tinie Tempah|Miami 2 Ibiza|digital download|1st Feb 2012|
Tinie Tempah|Till I'm Gone|digital download|1st Aug 2012|
Monkey Claw|Black Mountain|digital download|1st Feb 2012|
Monkey Claw|Iron Horse|digital download, streaming|1st June 2012|
Monkey Claw|Motor Mouth|digital download, streaming|1st Mar 2011|
Monkey Claw|Christmas Special|streaming|25st Dec 2012|31st Dec 2012");

            _results = MusicContractsParser.Parse(_filename);
        }