예제 #1
0
        internal void AssertAddAttribute(SdpServiceExpectedCall expected)
        {
            Assert.AreEqual(1, m_actualAddAttr.Count, "Expected Count AddAttr Calls");
            SdpServiceExpectedCall cur = m_actualAddAttr[0];

            Assert.AreEqual(expected.attrId, cur.attrId, "attrId");
            Assert.AreEqual(expected.attrType, cur.attrType, "attrType");
            Assert.AreEqual(expected.val, cur.val, "byte[] val");
            Assert.AreEqual(expected.attrLen, cur.attrLen, "attrLen");
            Assert.AreEqual(0, m_countWellKnownCalls, "m_countWellKnownCalls");
        }
        protected override void DoTest(byte[] expectedRecordBytes, ServiceRecord record)
        {
            byte[] buf = new byte[1024];
            WidcommSdpServiceCreator creator = new WidcommSdpServiceCreator();
            TestSdpService2          iface   = new TestSdpService2();

            creator.CreateServiceRecord(record, iface);
            //
            if (expectedRecordBytes == Data_SdpCreator_SingleElementTests.RecordBytes_Empty)
            {
                Debug.Assert(!resultMap.ContainsKey(expectedRecordBytes), "manually handled!");
                iface.AssertAreZeroAddAttributeCalls();
                iface.AssertAreZeroWellKnownCalls();
            }
            else
            {
                // All other expected results are in the mapping table.
                // Next can throw KeyNotFoundException.
                SdpServiceExpectedCall expected = resultMap[expectedRecordBytes];
                iface.AssertAddAttribute(expected);
            }
        }