Fix Remove Tag from AtomTags and Fix Remove Tag Test (#102)

This commit is contained in:
Lucas Ribeiro 2020-01-23 17:09:27 -03:00 committed by Adam Ramberg
parent a3db8f13e9
commit 82e78f51d3
2 changed files with 4 additions and 2 deletions

View File

@ -141,7 +141,7 @@ namespace UnityAtoms.Tags
public void RemoveTag(string tag)
{
if (tag == null) return;
if (_sortedTags.ContainsKey(tag)) return;
if (!_sortedTags.ContainsKey(tag)) return;
_sortedTags.Remove(tag);
Tags = new ReadOnlyList<StringConstant>(_sortedTags.Values);

View File

@ -94,9 +94,11 @@ namespace UnityAtoms.Tags.Tests
using (new ProfilerMarker("MySystem.RemoveTag").Auto())
{
atomicTags.RemoveTag("b");
atomicTags.RemoveTag(newConstant.Value);
}
Assert.AreEqual(random_tags_raw.Count, atomicTags.Tags.Count);
Assert.IsFalse(atomicTags.HasTag(newConstant.Value));
using (new ProfilerMarker("MySystem.AddTagAgain").Auto())
{