Beispiel #1
0
		public void Should_call_source_and_seed_methods_asynchronously_but_in_the_proper_order()
		{
			var queue = new Queue<string>();

			const int needListSize = 100;
			var partialDataAccessSourceMock = new PartialDataAccessMock(RdcNeedType.Source.ToString(), queue);
			var partialDataAccessSeedMock = new PartialDataAccessMock(RdcNeedType.Seed.ToString(), queue);
			var needList = GenerateAlternatedNeeds(needListSize).ToList();
			var result = NeedListParser.ParseAsync(partialDataAccessSourceMock, partialDataAccessSeedMock,
			                                       Stream.Null, needList, CancellationToken.None);
			result.Wait();
			var calls = queue.ToList();
			for (var i = 0; i < needListSize; i++)
			{
				Assert.Equal(string.Format("{0}{1}", needList[i].BlockType, needList[i].BlockLength), calls[i]);
			}
		}
Beispiel #2
0
        public void Should_call_source_and_seed_methods_asynchronously_but_in_the_proper_order()
        {
            var queue = new Queue <string>();

            const int needListSize = 100;
            var       partialDataAccessSourceMock = new PartialDataAccessMock(RdcNeedType.Source.ToString(), queue);
            var       partialDataAccessSeedMock   = new PartialDataAccessMock(RdcNeedType.Seed.ToString(), queue);
            var       needList = GenerateAlternatedNeeds(needListSize).ToList();
            var       result   = NeedListParser.ParseAsync(partialDataAccessSourceMock, partialDataAccessSeedMock,
                                                           Stream.Null, needList, CancellationToken.None);

            result.Wait();
            var calls = queue.ToList();

            for (var i = 0; i < needListSize; i++)
            {
                Assert.Equal(string.Format("{0}{1}", needList[i].BlockType, needList[i].BlockLength), calls[i]);
            }
        }