public void CreateSoundIsCreated(string soundResRef) { Location startLocation = NwModule.Instance.StartingLocation; NwSound? sound = NwSound.Create(soundResRef, startLocation); Assert.That(sound, Is.Not.Null, $"Sound {soundResRef} was null after creation."); Assert.That(sound !.IsValid, Is.True, $"Sound {soundResRef} was invalid after creation."); createdTestObjects.Add(sound); }
public void SerializeSoundCreatesValidData(string soundResRef) { Location startLocation = NwModule.Instance.StartingLocation; NwSound? sound = NwSound.Create(soundResRef, startLocation); Assert.That(sound, Is.Not.Null, $"Sound {soundResRef} was null after creation."); Assert.That(sound !.IsValid, Is.True, $"Sound {soundResRef} was invalid after creation."); createdTestObjects.Add(sound); byte[]? soundData = sound.Serialize(); Assert.That(soundData, Is.Not.Null); Assert.That(soundData, Has.Length.GreaterThan(0)); NwSound?sound2 = NwSound.Deserialize(soundData !); Assert.That(sound2, Is.Not.Null); Assert.That(sound2 !.IsValid, Is.True); createdTestObjects.Add(sound2); Assert.That(sound2.Area, Is.Null); }