Esempio n. 1
0
        public void Test_PatchTask_TransferResponse_FailWithAbortSignal()
        {
            var pipeLine = new Mock <ISubGridPipelineBase>();

            pipeLine.Setup(mk => mk.Aborted).Returns(true);

            PatchTask task = new PatchTask
            {
                PipeLine = pipeLine.Object
            };

            task.TransferResponse(new IClientLeafSubGrid[] { }).Should().BeFalse();
        }
Esempio n. 2
0
        public void Test_PatchTask_TransferResponse()
        {
            var pipeLine = new Mock <ISubGridPipelineBase>();

            pipeLine.Setup(mk => mk.Aborted).Returns(false);

            PatchTask task = new PatchTask
            {
                PipeLine = pipeLine.Object
            };

            ClientHeightLeafSubGrid transferSubgrid = new ClientHeightLeafSubGrid(null, null, 0, 1, 0);

            task.TransferResponse(new IClientLeafSubGrid[] { transferSubgrid });

            Assert.True(task.PatchSubGrids.Count == 1,
                        $"Count of transferred subgrids not 1 as expected (= {task.PatchSubGrids.Count}");
            Assert.True(task.PatchSubGrids[0] == transferSubgrid,
                        $"Transferred subgrid is not the same as the one passed into the task.");
        }