示例#1
0
        public void IncludesEntityGroup()
        {
            var         component    = new FrigateAIComponent("");
            JsonElement deserialized = JsonSerializer.Deserialize <JsonElement>(component.Save());

            Assert.Equal(FrigateAIComponent.ENTITY_GROUP, deserialized.GetProperty("EntityGroup").GetString());
        }
示例#2
0
        public void SerializesAndDeserializesCorrectly()
        {
            var    component = new FrigateAIComponent("groupid");
            string saved     = component.Save();

            var newComponent = FrigateAIComponent.Create(saved);

            Assert.Equal(component.ActivationGroupId, newComponent.ActivationGroupId);
            Assert.Equal(component.ReverserCooldown, newComponent.ReverserCooldown);
            Assert.Equal(component.CurrentReverserCooldown, newComponent.CurrentReverserCooldown);
        }