本文整理汇总了C#中Sequence.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Sequence.Select方法的具体用法?C# Sequence.Select怎么用?C# Sequence.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequence
的用法示例。
在下文中一共展示了Sequence.Select方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateSingleCharDnaSequence
public void ValidateSingleCharDnaSequence()
{
// Gets the actual sequence and the alphabet from the Xml
string alphabetName = this.utilityObj.xmlUtil.GetTextValue(
Constants.SimpleDnaAlphabetNode, Constants.AlphabetNameNode);
string actualSequence = this.utilityObj.xmlUtil.GetTextValue(
Constants.SimpleDnaAlphabetNode, Constants.ExpectedSingleChar);
// Logs information to the log file
ApplicationLog.WriteLine(string.Concat(
"Sequence BVT: Sequence is as expected."));
Sequence createSequence = new Sequence(
Utility.GetAlphabet(alphabetName), actualSequence);
Assert.IsNotNull(createSequence);
// Validate the createdSequence
string seqNew = new string(createSequence.Select(a => (char)a).ToArray());
Assert.AreEqual(seqNew, actualSequence);
ApplicationLog.WriteLine(string.Concat(
"Sequence BVT: Sequence is as expected."));
Assert.AreEqual(Utility.GetAlphabet(alphabetName), createSequence.Alphabet);
ApplicationLog.WriteLine(string.Concat(
"Sequence BVT: Sequence Alphabet is as expected."));
ApplicationLog.WriteLine(
"Sequence BVT: The DNA with single character Sequence is completed successfully.");
}
示例2: TestSequenceConstructorWithISequenceArgument
public void TestSequenceConstructorWithISequenceArgument()
{
ISequence seq = new Sequence(Alphabets.DNA, "ATCG");
ISequence newSeq = new Sequence(seq);
string expectedSequence = "ATCG";
string actualSequence = new string(newSeq.Select(x => (char)x).ToArray());
Assert.AreEqual(expectedSequence, actualSequence);
}
示例3: CreateTriggerStatement
public CreateTriggerStatement(Qualified<SchemaName, TriggerName> triggerName, Qualified<SchemaName, TableName> tableName, TriggerTypeToken triggerType, Sequence<DmlOperationToken> triggerOperations, ReplicationToken replication, Statement statement) {
Debug.Assert(triggerName != null);
Debug.Assert(triggerOperations != null);
Debug.Assert(triggerType != null);
Debug.Assert(tableName != null);
Debug.Assert(statement != null);
this.triggerName = triggerName;
this.tableName = tableName;
this.statement = statement;
this.triggerOperations = triggerOperations.Select(token => token.Operation).ToList();
this.replication = replication;
type = triggerType;
}
示例4: Method
public Method(Identifier identifier, Sequence<Argument> arguments, Type type, Block block)
{
Name = identifier.Value;
Arguments = arguments;
Type = type;
Block = block;
foreach (var argument in arguments)
{
argument.Parent = this;
}
Type.Parent = this;
Block.Parent = this;
FullName = string.Format("{0}:{1}", Name, String.Join(":", Arguments.Select(a => a.Type)));
}
示例5: ValidateSequenceConstructor
public void ValidateSequenceConstructor()
{
// Get input and expected values from xml
string alphabetName = this.utilityObj.xmlUtil.GetTextValue(
Constants.DnaDerivedSequenceNode, Constants.AlphabetNameNode);
string expectedSequence = this.utilityObj.xmlUtil.GetTextValue(
Constants.DnaDerivedSequenceNode, Constants.ExpectedDerivedSequence);
IAlphabet alphabet = Utility.GetAlphabet(alphabetName);
List<byte[]> byteArray = new List<byte[]>
{
Encoding.UTF8.GetBytes(expectedSequence),
};
// Validating Constructor.
Sequence constructorSequence = new Sequence(alphabet, byteArray[0]);
Assert.AreEqual(expectedSequence,
new string(constructorSequence.Select(a => (char)a).ToArray()));
ApplicationLog.WriteLine(string.Concat(
"Sequence BVT: Validation of Sequence Constructor completed successfully."));
}
示例6: AlphabetStaticCtorValidatePhaseOne
public void AlphabetStaticCtorValidatePhaseOne()
{
Sequence seq =
new Sequence(Alphabets.DNA, "ATAGC");
Assert.AreEqual(seq.Count, 5);
Assert.AreEqual(new string(seq.Select(a => (char)a).ToArray()), "ATAGC");
ApplicationLog.WriteLine(
"Alphabets BVT: Validation of Static Constructor completed successfully.");
}