Example #1
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));
        }
Example #2
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));
        }
Example #3
0
        public void WeCanChangeTheValueOfAPropertyOfAnObject()
        {
            SampleTester <float> test    = new SampleTester <float>();
            FloatSampler         sampler = new FloatSampler(test, "property", x);

            float oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property, Is.Not.EqualTo(oldValue));
        }
Example #4
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));
        }
Example #5
0
        public void WeCanChangeTheValueOfAPropertyOfAnObject()
        {
            SampleTester <Color> test = new SampleTester <Color>()
            {
                property = new Color(0.5f, 0.5f, 0.5f, 0.5f)
            };
            ColorSampler sampler = new ColorSampler(test, "property", r, null, null, null);

            Color oldValue = test.property;

            sampler.Sample(0.5f);

            Assert.That(test.property.r, Is.Not.EqualTo(oldValue.r));
            Assert.That(test.property.g, Is.EqualTo(oldValue.g));
            Assert.That(test.property.b, Is.EqualTo(oldValue.b));
            Assert.That(test.property.a, Is.EqualTo(oldValue.a));
        }
Example #6
0
 public void WeWillGetAnErrorIfWeTryToSampleAMethod()
 {
     SampleTester <Vector3> test    = new SampleTester <Vector3>();
     Vector3Sampler         sampler = new Vector3Sampler(test, "Method", x, y, z);
 }
Example #7
0
 public void WeWillGetAnErrorIfWeTryToCreateASamplerForANonExistingMember()
 {
     SampleTester <Vector3> test    = new SampleTester <Vector3>();
     Vector3Sampler         sampler = new Vector3Sampler(test, "NonExistantMember", x, y, z);
 }