コード例 #1
0
        public void FrameStatistics_ContainsNoDuplicates()
        {
            var lightSection = new LightSectionBuilder()
            .WithAllLights(arbitraryLight)
            .Build();
              var frames = new FrameBuilder()
            .AddFrame()
            .WithFrameLength(1000)
            .WithRepeated(false)
            .WithLightSection(lightSection)
            .AddFrame()
            .WithFrameLength(1000)
            .WithRepeated(false)
            .WithLightSection(lightSection)
            .Build();
              var stats = new FrameStatistics(frames);

              Assert.AreEqual(8, stats.EnabledDirectionalComponents.Count);
        }
コード例 #2
0
        public void FrameStatistics_RecordsSceneLength()
        {
            var lightSection = new LightSectionBuilder()
            .WithAllLights(arbitraryLight)
            .Build();
              var frames = new FrameBuilder()
            .AddFrame()
            .WithFrameLength(1000)
            .WithRepeated(false)
            .WithLightSection(lightSection)
            .AddFrame()
            .WithFrameLength(500)
            .WithRepeated(false)
            .WithLightSection(lightSection)
            .Build();
              var stats = new FrameStatistics(frames);

              Assert.AreEqual(frames.Sum(frame => frame.Length), stats.SceneLength);
        }
コード例 #3
0
        public void FrameStatistics_ContainsExpectedComponentType()
        {
            var lightSection = new LightSectionBuilder()
            .WithLightInDirection(eDirection.North, arbitraryLight)
            .Build();
              var frames = new FrameBuilder()
            .AddFrame()
            .WithFrameLength(1000)
            .WithRepeated(false)
            .WithLightSection(lightSection)
            .Build();
              var stats = new FrameStatistics(frames);

              Assert.IsTrue(stats.AreEnabledForComponent(eComponentType.Light));
              Assert.IsFalse(stats.AreEnabledForComponent(eComponentType.Fan));
              Assert.IsFalse(stats.AreEnabledForComponent(eComponentType.Rumble));

              Assert.IsTrue(stats.AreEnabledForComponentAndDirection(new DirectionalComponent(eComponentType.Light, eDirection.North)));
              Assert.AreEqual(1, stats.EnabledDirectionalComponents.Count());
        }