Ejemplo n.º 1
0
        public void ViewShortClipFromNearAtEnd()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 0.1, //6 frames
                TimeScale             = 1,
                ClipIn                = 0,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 0.0751406848430634,
                VisibleLocalEndTime   = 0.1,
                VisibleRect           = new Rect()
                {
                    x      = 1435,
                    y      = 1,
                    width  = 475,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 1);
            Assert.AreEqual(1591.54126f, drawList[0].DrawRect.x, EPSILON);
            Assert.AreEqual(0.08333, drawList[0].LocalTime, EPSILON);
        }
Ejemplo n.º 2
0
        public void ViewShortClipWithClipInFromNearAtBeginning()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 0.05, //3  frames
                TimeScale             = 1,
                ClipIn                = 0.05,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 0.05,
                VisibleLocalEndTime   = 0.0834165304899216,
                VisibleRect           = new Rect()
                {
                    x      = 0,
                    y      = 1,
                    width  = 263,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 2);
            Assert.AreEqual(0, drawList[0].DrawRect.x, EPSILON);
            Assert.AreEqual(0.05, drawList[0].LocalTime, EPSILON);

            float xDiff = drawList[1].DrawRect.x - drawList[0].DrawRect.x;

            Assert.AreEqual(131.1726, xDiff, EPSILON);
        }
Ejemplo n.º 3
0
        public void ViewScaledClipWithClipInFromFar()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 0.25, //15  frames
                TimeScale             = 1,
                ClipIn                = 0.25,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 0.25,
                VisibleLocalEndTime   = 0.50,
                VisibleRect           = new Rect()
                {
                    x      = 0,
                    y      = 1,
                    width  = 652,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 2);
            Assert.AreEqual(0f, drawList[0].DrawRect.x, EPSILON);
            Assert.AreEqual(0.25, drawList[0].LocalTime, EPSILON);

            float xDiff = drawList[1].DrawRect.x - drawList[0].DrawRect.x;

            Assert.AreEqual(43.46667, xDiff, EPSILON);
        }
Ejemplo n.º 4
0
        public void ViewScaledClipWithClipInFromNearAtEnd()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 200,
                TimeScale             = 0.5,
                ClipIn                = 10,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 109.956161499023,
                VisibleLocalEndTime   = 110,
                VisibleRect           = new Rect()
                {
                    x      = 1849484.00f,
                    y      = 1,
                    width  = 811,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 2);
            Assert.AreEqual(1849524.125, drawList[0].DrawRect.x, EPSILON);
            Assert.AreEqual(109.95833333333334, drawList[0].LocalTime, EPSILON);

            float xDiff = drawList[1].DrawRect.x - drawList[0].DrawRect.x;

            Assert.AreEqual(154.125, xDiff, EPSILON);
        }
Ejemplo n.º 5
0
        public void ViewShortClipFromNearAtBeginning()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 0.1, //6 frames
                TimeScale             = 1,
                ClipIn                = 0,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 0,
                VisibleLocalEndTime   = 0.1,
                VisibleRect           = new Rect()
                {
                    x      = 0,
                    y      = 1,
                    width  = 722,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 1);
            Assert.AreEqual(0f, drawList[0].DrawRect.x);
            Assert.AreEqual(0f, drawList[0].LocalTime);

            float xDiff = drawList[1].DrawRect.x - drawList[0].DrawRect.x;

            Assert.AreEqual(120.3333f, xDiff, EPSILON);
        }
Ejemplo n.º 6
0
        public void ViewScaledClipFromNearAtBeginning()
        {
            PreviewClipInfo clipInfo = new PreviewClipInfo()
            {
                Duration              = 30, //1800 frames
                TimeScale             = 1,
                ClipIn                = 0,
                FramePerSecond        = 60,
                ImageDimensionRatio   = 1.684f,
                VisibleLocalStartTime = 29.9543800354004,
                VisibleLocalEndTime   = 30,
                VisibleRect           = new Rect()
                {
                    x      = 276922,
                    y      = 1,
                    width  = 422,
                    height = 25,
                },
            };
            List <PreviewDrawInfo> drawList = new List <PreviewDrawInfo>();

            PreviewUtility.EnumeratePreviewImages(ref clipInfo, (PreviewDrawInfo drawInfo) => {
                drawList.Add(drawInfo);
            });

            Assert.GreaterOrEqual(drawList.Count, 2);
            Assert.AreEqual(276881.4687f, drawList[0].DrawRect.x, EPSILON);
            Assert.AreEqual(29.95f, drawList[0].LocalTime, EPSILON);

            float xDiff = drawList[1].DrawRect.x - drawList[0].DrawRect.x;

            Assert.AreEqual(154.187f, xDiff, EPSILON);
        }
Ejemplo n.º 7
0
        // Copied from PriorityQueueTest, to ensure consistency.
        private void CheckOrder <TData>(AlternativePriorityQueue <int, TData> q, int nodesToKeep = 0, bool reversed = false)
        {
            int  curr  = 0;
            bool first = true;

            while (q.Count > nodesToKeep)
            {
                int next = q.Dequeue().Priority;
                Console.WriteLine(next);
                if (!first)
                {
                    int comparison = next.CompareTo(curr);
                    if (reversed)
                    {
                        Assert.LessOrEqual(comparison, 0);
                    }
                    else
                    {
                        Assert.GreaterOrEqual(comparison, 0);
                    }
                }

                first = false;
                curr  = next;
            }
        }
Ejemplo n.º 8
0
        public void PlayMyTurnTest()
        {
            var action = Game.PlayerOne.Play(Game.PlayerTwo);

            Assert.AreEqual(typeof(FiringAction), action.GetType());

            Assert.GreaterOrEqual(((FiringAction)action).OpponentCell, 0);
            Assert.LessOrEqual(((FiringAction)action).OpponentCell, Game.PlayerOne.Board.CellCount);
        }
Ejemplo n.º 9
0
        public void CheckMultiplyPassTest()
        {
            double mul1           = 10.0;
            double mul2           = 6.0;
            double expectedResult = 60.0;
            double actualResult   = calc.Multiply(mul1, mul2);

            Assert.GreaterOrEqual(expectedResult, actualResult, "Result is greather than {0}", expectedResult);
        }
Ejemplo n.º 10
0
        public void ChecSumOfArray()

        {
            int suma           = 10;
            int sumb           = 50;
            int sumc           = 15;
            int sumd           = 25;
            int expectedResult = 100;
            int actualResult   = scalc.SumOfAnArray(suma, sumb, sumc, sumd);

            Assert.GreaterOrEqual(actualResult, expectedResult, "Result is equal to 100");
        }
Ejemplo n.º 11
0
        public async Task AssertMockData()
        {
            var(connection, options) = await CreateUniqueMockDbConnectionForThisTest();

            try
            {
                using (var context = new FittifyContext(options))
                {
                    var queryResult = context.Categories.ToList();

                    Assert.GreaterOrEqual(queryResult.Count, 9);
                }
            }
            finally
            {
                connection.Close();
            }
        }
Ejemplo n.º 12
0
 public void Test2()
 {
     Assert.GreaterOrEqual(3, _service.GetTreeMaxpath());
 }
Ejemplo n.º 13
0
 public void GetDetailResultForm_Test2()
 {
     Assert.GreaterOrEqual(_formLogic.GetDetailResultForm(1).Questions.Count, 1);
 }
Ejemplo n.º 14
0
 public void GetDetailResultForm_Test()
 {
     Assert.GreaterOrEqual(_formLogic.GetDetailResultForm(1).NrVotes, 1);
 }