当前位置: 首页>>代码示例>>C#>>正文


C# Sequence.Select方法代码示例

本文整理汇总了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.");
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:31,代码来源:SequenceBvtTestCases.cs

示例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);
 }
开发者ID:cpatmoore,项目名称:bio,代码行数:8,代码来源:TestSequencesCopyToForBio.cs

示例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;
		}
开发者ID:avonwyss,项目名称:bsn-modulestore,代码行数:13,代码来源:CreateTriggerStatement.cs

示例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)));
        }
开发者ID:HEm3R,项目名称:MI-RUN-COMPILER,代码行数:17,代码来源:Method.cs

示例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."));
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:21,代码来源:SequenceBvtTestCases.cs

示例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.");
        }
开发者ID:cpatmoore,项目名称:bio,代码行数:10,代码来源:AlphabetsBvtTestCases.cs


注:本文中的Sequence.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。