Beispiel #1
0
        public void setters_should_set_dirty_bit_to_true()
        {
            var component = new SpatialOSNonBlittableComponent();

            Assert.AreEqual(BlittableBoolFalse, component.DirtyBit, "Dirty bit is initially false.");

            component.BoolField = BoolValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting bool field.");

            component.DirtyBit    = false;
            component.DoubleField = DoubleValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting double field.");

            component.DirtyBit   = false;
            component.FloatField = FloatValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting float field.");

            component.DirtyBit = false;
            component.IntField = IntValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting int field.");

            component.DirtyBit  = false;
            component.LongField = LongValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting long field.");

            component.DirtyBit    = false;
            component.StringField = StringValue;
            Assert.AreEqual(BlittableBoolTrue, component.DirtyBit, "Dirty bit true after setting string field.");
        }
Beispiel #2
0
        public void component_should_implement_ISpatialComponentData()
        {
            var component = new SpatialOSNonBlittableComponent();

            Assert.True(component is ISpatialComponentData,
                        "SpatialOSNonBlittableComponent implements ISpatialComponentData");
        }
Beispiel #3
0
        public void component_should_subclass_unityengine_component()
        {
            var component = new SpatialOSNonBlittableComponent();

            Assert.True(component is Component,
                        "SpatialOSNonBlittableComponent is subclass of UnityEngine.Component");
        }
Beispiel #4
0
        public void getters_should_return_set_values()
        {
            var component = new SpatialOSNonBlittableComponent();

            component.BoolField   = true;
            component.DoubleField = DoubleValue;
            component.FloatField  = FloatValue;
            component.IntField    = IntValue;
            component.LongField   = LongValue;
            component.StringField = StringValue;

            Assert.AreEqual(DoubleValue, component.DoubleField, 0.001, "Double Field");
            Assert.AreEqual(FloatValue, component.FloatField, 0.001, "Float Field");
            Assert.AreEqual(IntValue, component.IntField, "Int Field");
            Assert.AreEqual(LongValue, component.LongField, "Long Field");
            Assert.AreEqual(BoolValue, component.BoolField, "Bool Field");
            Assert.AreEqual(StringValue, component.StringField, "String Field");
        }