本文整理汇总了C#中ErlAtom.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ErlAtom.Equals方法的具体用法?C# ErlAtom.Equals怎么用?C# ErlAtom.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErlAtom
的用法示例。
在下文中一共展示了ErlAtom.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ErlAtomTest
public void ErlAtomTest()
{
var am_test = new ErlAtom("test");
Assert.IsTrue(am_test.Equals(new ErlAtom("test")));
Assert.AreEqual(am_test, new ErlAtom("test"));
Assert.AreEqual("test", am_test.Value);
Assert.AreEqual("test", am_test.ToString());
Assert.IsTrue(am_test.IsScalar);
Assert.AreEqual(ErlTypeOrder.ErlAtom, am_test.TypeOrder);
Assert.IsTrue(am_test.Matches(new ErlAtom("test")));
Assert.AreEqual(new ErlVarBind(), am_test.Match(new ErlAtom("test")));
var am_Test = new ErlAtom("Test");
Assert.AreEqual("'Test'", am_Test.ToString());
Assert.AreEqual(4, am_Test.Length);
Assert.AreNotEqual(am_test, am_Test);
IErlObject temp = null;
Assert.IsFalse(am_test.Subst(ref temp, new ErlVarBind()));
Assert.IsTrue(am_Test.Visit(true, (acc, o) => acc));
Assert.DoesNotThrow(() => { var x = am_test.ValueAsObject; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsInt; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsLong; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsDecimal; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsDateTime; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsTimeSpan; });
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsDouble; });
Assert.DoesNotThrow(() => { var x = am_test.ValueAsString; });
Assert.DoesNotThrow(() => { var x = am_test.ValueAsBool; });
Assert.AreEqual('a', new ErlAtom("a").ValueAsChar);
Assert.Throws<ErlIncompatibleTypesException>(() => { var x = am_test.ValueAsByteArray; });
string s = am_test; // Implicit conversion
Assert.AreEqual("test", s);
ErlAtom a = "abc"; // Implicit conversion
Assert.AreEqual("abc", a.Value);
}
示例2: RPCcast
public void RPCcast(ErlAtom node, ErlAtom mod, ErlAtom fun, ErlList args, IErlObject ioServer)
{
if (node.Equals(m_Node.NodeName))
throw new ErlException(StringConsts.ERL_CONN_CANT_RPC_TO_LOCAL_NODE_ERROR);
else
{
var msg = Internal.ErlRpcServer.EncodeRPCcast(m_Self, mod, fun, args, ioServer);
var conn = m_Node.Connection(node);
if (conn == null)
throw new ErlConnectionException(
node, StringConsts.ERL_CONN_CANT_CONNECT_TO_NODE_ERROR.Args(node));
conn.Send(m_Self, ConstAtoms.Rex, msg);
}
}