public void TextPropertyAlt2Write() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var prop = new TextProperty(Alt2TextName) { Unknown8 = Alt2TextUnknown8, Value = Alt2TextValue, Unknown4 = Alt2TextUnknown, Unknown5 = Alt2TextUnknown5, Unknown6 = Alt2TextUnknown6 }; prop.FormatData.Add(new TextFormatData() { Name = Alt2TextFormatName, Unknown1 = Alt2TextFormatUnknown1, Unknown2 = Alt2TextFormatUnknown2, Data = Alt2TextFormatData }); prop.Serialize(writer); Assert.AreEqual(111, prop.SerializedLength); CollectionAssert.AreEqual(Alt2TextBytes, stream.ToArray()); } }
public void TextPropertyAlt2Write() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var text = new ArgumentFormatTextEntry(Alt2TextFlags) { SourceFormat = new BaseTextEntry(Alt2TextSourceFlags) { Key = Alt2TextKey, Value = Alt2TextValue } }; text.Arguments.Add(Alt2ArgumentFormat); var prop = new TextProperty(Alt2TextName) { Text = text }; prop.Serialize(writer, BuildVersion); Assert.AreEqual(111, prop.SerializedLength); CollectionAssert.AreEqual(Alt2TextBytes, stream.ToArray()); } }
public void TextPropertyNoneWrite() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var prop = new TextProperty(NoneTextName) { Text = new NoneTextEntry(NoneTextFlags) }; prop.Serialize(writer, BuildVersion); Assert.AreEqual(5, prop.SerializedLength); CollectionAssert.AreEqual(NoneTextBytes, stream.ToArray()); } }
public void TextPropertyWrite() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var prop = new TextProperty(TextName) { Value = TextValue, Unknown4 = TextUnknown }; prop.Serialize(writer); Assert.AreEqual(21, prop.SerializedLength); CollectionAssert.AreEqual(TextBytes, stream.ToArray()); } }
public void TextPropertyNoneWrite() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var prop = new TextProperty(NoneTextName) { Unknown4 = NoneTextUnknown4, Unknown5 = NoneTextUnknown5 }; prop.Serialize(writer); Assert.AreEqual(5, prop.SerializedLength); CollectionAssert.AreEqual(NoneTextBytes, stream.ToArray()); } }
public void TextPropertyAltWrite() { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { var prop = new TextProperty(AltTextName) { Text = new BaseTextEntry(AltTextFlags) { Key = AltTextKey, Value = AltTextValue } }; prop.Serialize(writer, BuildVersion); Assert.AreEqual(57, prop.SerializedLength); CollectionAssert.AreEqual(AltTextBytes, stream.ToArray()); } }