コード例 #1
0
ファイル: WithTheVector3Sampler.cs プロジェクト: Joelone/FFWD
        public void WeCanSampleOnAPrivateField()
        {
            SampleTester<Vector3> test = new SampleTester<Vector3>();
            Vector3Sampler sampler = new Vector3Sampler(test, "privateField", x, y, z);
            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.GetPrivateField(), Is.Not.EqualTo(oldValue));
        }
コード例 #2
0
        public void WeCanSampleOnAPrivateField()
        {
            SampleTester <Vector3> test    = new SampleTester <Vector3>();
            Vector3Sampler         sampler = new Vector3Sampler(test, "privateField", x, y, z);
            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.GetPrivateField(), Is.Not.EqualTo(oldValue));
        }
コード例 #3
0
ファイル: WithTheVector3Sampler.cs プロジェクト: Joelone/FFWD
        public void WeCanChangeTheValueOfAPropertyOfAnObject()
        {
            SampleTester<Vector3> test = new SampleTester<Vector3>();
            Vector3Sampler sampler = new Vector3Sampler(test, "property", x, y, z);

            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property, Is.Not.EqualTo(oldValue));
        }
コード例 #4
0
        public void WeCanChangeTheValueOfAFieldOfAnObject()
        {
            SampleTester <Vector3> test    = new SampleTester <Vector3>();
            Vector3Sampler         sampler = new Vector3Sampler(test, "field", x, y, z);

            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.field, Is.Not.EqualTo(oldValue));
        }
コード例 #5
0
        public void WeCanSampleWithFewerCurvesWithoutDestroyingExistingValues()
        {
            SampleTester <Vector3> test = new SampleTester <Vector3>()
            {
                property = new Vector3(3)
            };
            Vector3Sampler sampler = new Vector3Sampler(test, "property", x, null, null);

            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property.x, Is.Not.EqualTo(oldValue.x));
            Assert.That(test.property.y, Is.EqualTo(oldValue.y));
            Assert.That(test.property.z, Is.EqualTo(oldValue.z));
        }
コード例 #6
0
ファイル: WithTheVector3Sampler.cs プロジェクト: Joelone/FFWD
        public void WeCanSampleWithFewerCurvesWithoutDestroyingExistingValues()
        {
            SampleTester<Vector3> test = new SampleTester<Vector3>() { property = new Vector3(3) };
            Vector3Sampler sampler = new Vector3Sampler(test, "property", x, null, null);

            Vector3 oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property.x, Is.Not.EqualTo(oldValue.x));
            Assert.That(test.property.y, Is.EqualTo(oldValue.y));
            Assert.That(test.property.z, Is.EqualTo(oldValue.z));
        }