public void OneSeqEmpty() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(65535, ElementType.ElementSequence, ElementTypeDescriptor.ElementSequence, new ExpectedServiceElement[0]) }; DoTest(expected, Data_SimpleRecords.OneSeqEmpty); }
public void Empty() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[0]; ServiceRecord record = DoTest(expected, Data_SimpleRecords.Empty); Assert.AreEqual(Data_SimpleRecords.Empty, record.SourceBytes, "SourceBytes"); }
public void OneStringBadUtf8() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.TextString, ElementTypeDescriptor.TextString, Data_SimpleRecords.OneStringBadUtf8_ValueBytes) }; DoTest(expected, Data_SimpleRecords.OneStringBadUtf8); }
public void OneStringZeroLength() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.TextString, ElementTypeDescriptor.TextString, new byte[0]) }; DoTest(expected, Data_SimpleRecords.OneStringZeroLength); }
public void OneUrlLazyCreation() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Url, ElementTypeDescriptor.Url, Data_SimpleRecords.OneUrlByteArrayValue) }; ServiceRecord record = DoTestLazyUrlCreation(expected, Data_SimpleRecords.OneUrl); Assert.AreEqual(Data_SimpleRecords.OneUrl, record.SourceBytes, "SourceBytes"); }
public void OneAltWithNil() { ExpectedServiceElement expectedValue = new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null); ExpectedServiceElement[] expectedFirstElementsChildren = new ExpectedServiceElement[] { expectedValue }; ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(65535, ElementType.ElementAlternative, ElementTypeDescriptor.ElementAlternative, expectedFirstElementsChildren) }; DoTest(expected, Data_SimpleRecords.OneAltWithNil); }
private static void DoAreEqual(ExpectedServiceAttribute[] expectedAttributes, ServiceRecord record, int depth) { Assert.AreEqual(expectedAttributes.Length, record.Count, "Number of attributes."); for (int i = 0; i < expectedAttributes.Length; ++i) { ExpectedServiceAttribute expected = expectedAttributes[i]; ServiceAttribute row = record[i]; ServiceAttributeId expectedId = (ServiceAttributeId)expected.Id; Assert.AreEqual(expectedId, row.Id, "Attr Id."); DoAreEqual(expected, row.Value, depth + 1); }//for }
public void OneAltWithOneSeqWithNil() { ExpectedServiceElement expectedValue = new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null); ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(65535, ElementType.ElementAlternative, ElementTypeDescriptor.ElementAlternative, new ExpectedServiceElement[] { new ExpectedServiceElement(ElementType.ElementSequence, ElementTypeDescriptor.ElementSequence, new ExpectedServiceElement[] { new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null) }) }) }; DoTest(expected, Data_SimpleRecords.OneAltWithOneSeqWithNil); }
public void OneAltWith__OneAltWithTwoNil_And_OneAltWithOneNil_And_Int8() { ExpectedServiceElement expectedValue = new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null); ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(65535, ElementType.ElementAlternative, ElementTypeDescriptor.ElementAlternative, new ExpectedServiceElement[] { new ExpectedServiceElement(ElementType.ElementAlternative, ElementTypeDescriptor.ElementAlternative, new ExpectedServiceElement[] { new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null), new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null) }), new ExpectedServiceElement(ElementType.ElementAlternative, ElementTypeDescriptor.ElementAlternative, new ExpectedServiceElement[] { new ExpectedServiceElement(ElementType.Nil, ElementTypeDescriptor.Nil, null), }) }), new ExpectedServiceAttribute(2, ElementType.UInt8, ElementTypeDescriptor.UnsignedInteger, 0x99) }; DoTest(expected, Data_SimpleRecords.OneAltWith__OneAltWithTwoNil_And_OneAltWithOneNil__And_Int8); }
public void OneUrl() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Url, ElementTypeDescriptor.Url, new Uri(Data_SimpleRecords.OneUrlStringValue)) }; DoTest(expected, Data_SimpleRecords.OneUrl); }
public void Int8() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(0, ElementType.Int8, ElementTypeDescriptor.TwosComplementInteger, 0) }; DoTest(expected, Data_SimpleRecords.OneInt8ZeroZero); }
public void OneBooleanNonZero() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Boolean, ElementTypeDescriptor.Boolean, true) }; DoTest(expected, Data_SimpleRecords.OneBooleanNonZero); }
public void Nil() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(0, ElementType.Nil, ElementTypeDescriptor.Nil, null) }; DoTest(expected, Data_SimpleRecords.OneNil); }
public void OneUuid32() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Uuid32, ElementTypeDescriptor.Uuid, Data_SimpleRecords.OneUuid32Value) }; DoTest(expected, Data_SimpleRecords.OneUuid32); }
public void UInt128() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.UInt128, ElementTypeDescriptor.UnsignedInteger, Data_SimpleRecords.OneUInt128_Value) }; DoTest(expected, Data_SimpleRecords.OneUInt128_F123_E987); }
public void Int64() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Int64, ElementTypeDescriptor.TwosComplementInteger, Data_SimpleRecords.OneInt64_F123_E987654305060708_Value) }; DoTest(expected, Data_SimpleRecords.OneInt64_F123_E987654305060708); }
public void Int8TopBitSet() { ExpectedServiceAttribute[] expected = new ExpectedServiceAttribute[] { new ExpectedServiceAttribute(Data_SimpleRecords.IdF123Uint, ElementType.Int8, ElementTypeDescriptor.TwosComplementInteger, Data_SimpleRecords.OneInt8F123_E9Value) }; DoTest(expected, Data_SimpleRecords.OneInt8F123_E9); }