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


C# IEnumerable.SequenceEqual方法代码示例

本文整理汇总了C#中IEnumerable.SequenceEqual方法的典型用法代码示例。如果您正苦于以下问题:C# IEnumerable.SequenceEqual方法的具体用法?C# IEnumerable.SequenceEqual怎么用?C# IEnumerable.SequenceEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEnumerable的用法示例。


在下文中一共展示了IEnumerable.SequenceEqual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CallEquals

        /// <summary>
        /// Check if a call to this function with the given arguments is equal to an expression.
        /// </summary>
        /// <param name="Arguments"></param>
        /// <param name="E"></param>
        /// <returns></returns>
        public virtual bool CallEquals(IEnumerable<Expression> Arguments, Expression E)
        {
            Call C = E as Call;
            if (ReferenceEquals(C, null)) return false;

            return Equals(C.Target) && Arguments.SequenceEqual(C.Arguments);
        }
开发者ID:JackWangCUMT,项目名称:ComputerAlgebra,代码行数:13,代码来源:Function.cs

示例2: CheckFinishingGeneration

 /**
  * Check the end of the game
  * if a new generation died or changed then the end
  * @param currentGeneration
  * @param nextGeneration
  * @return if end then true
  */
 bool CheckFinishingGeneration(IEnumerable<Cell> currentGeneration, 
     IEnumerable<Cell> nextGeneration)
 {
     if (currentGeneration != null && nextGeneration != null)
         return (nextGeneration.Count() == 0 || currentGeneration.SequenceEqual(nextGeneration));
     else
         return true;
 }
开发者ID:nazargulov,项目名称:Conways-Game-of-Life,代码行数:15,代码来源:Game.cs

示例3: VerifyAgainstBaselineResults

        private static void VerifyAgainstBaselineResults(EntityDataReader reader, IEnumerable<object> expectedResults)
        {
            var actualResults = new List<object>();
            while (reader.Read())
            {
                actualResults.Add(reader.GetValue(0));
            }

            Assert.True(expectedResults.SequenceEqual(actualResults));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:10,代码来源:SqlGeneratorTests.cs

示例4: RandomizePlayerOrder

        public IEnumerable<string> RandomizePlayerOrder(IEnumerable<string> players)
        {
            IEnumerable<string> randomOrderOfPlayers = players.OrderBy(c => generator.Generate(1, players.Count())).ToList();

            if (players.SequenceEqual(randomOrderOfPlayers))
            {
                randomOrderOfPlayers = RandomizePlayerOrder(randomOrderOfPlayers);
            }

            return randomOrderOfPlayers;
        }
开发者ID:foxguardsolutions,项目名称:DBudwin-Monopoly,代码行数:11,代码来源:PlayerFactory.cs

示例5: AssertDatabaseMigrationsAreEqual

        private static void AssertDatabaseMigrationsAreEqual(
            string appliedMigrationId, 
            IEnumerable<string> expected, 
            IEnumerable<string> actual)
        {
            if (expected.SequenceEqual(actual))
            {
                return;
            }

            throw new MigrationAssertFailedExecption(
                appliedMigrationId,
                $"Expected migrations did not match the actual migrations after migrating to {appliedMigrationId}.");
        }
开发者ID:GalenHealthcare,项目名称:Galen.Ef.Deployer,代码行数:14,代码来源:MigrationTestRunner.cs

示例6: SetSelectionCommand

        /// <summary>
        /// Constructor</summary>
        /// <param name="selectionContext">Selection context. See <see cref="ISelectionContext"/>.</param>
        /// <param name="previous">Selection's previous state</param>
        /// <param name="next">Selection's next state</param>
        public SetSelectionCommand(
            ISelectionContext selectionContext,
            IEnumerable<object> previous,
            IEnumerable<object> next)
            : base("Set Selection".Localize())
        {
            if (selectionContext == null)
                throw new ArgumentNullException("selectionContext");

            m_selectionContext = selectionContext;

            m_previous = Snapshot(previous);
            // if previous is the same as next, then use the same array
            if (previous.SequenceEqual(next))
                m_next = m_previous;
            else
                m_next = Snapshot(next);
        }
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:23,代码来源:SetSelectionCommand.cs

示例7: ContainsCompletions

        private void ContainsCompletions(IEnumerable<string> completions, params string[] expected)
        {
            var same = completions.SequenceEqual(expected);
            if (!same)
            {
                System.Console.Error.WriteLine("Expected");
                System.Console.Error.WriteLine("--------");
                foreach (var completion in expected)
                {
                    System.Console.WriteLine(completion);
                }
                System.Console.Error.WriteLine();
                System.Console.Error.WriteLine("Found");
                System.Console.Error.WriteLine("-----");
                foreach (var completion in completions)
                {
                    System.Console.WriteLine(completion);
                }

            }
            Assert.Equal(expected, completions);
        }
开发者ID:Jenkin0603,项目名称:myvim,代码行数:22,代码来源:IntellisenseOrderFacts.cs

示例8: SequenceEquals

            private static bool SequenceEquals(IEnumerable<string> s1, IEnumerable<string> s2)
            {
                if (s1 == s2)
                {
                    return true;
                }

                return s1 != null && s2 != null && s1.SequenceEqual(s2);
            }
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:Controller.Session_ComputeModel.cs

示例9: MetaDataChanged

 private static bool MetaDataChanged(
     IEnumerable<KeyValuePair<string, string>> lh,
     IEnumerable<KeyValuePair<string, string>> rh)
 {
     return lh.SequenceEqual(rh, new NameValueEqualityComparer()) == false;
 }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:6,代码来源:ContentController.cs

示例10: CheckCompatibility

 private bool CheckCompatibility(Game game, IEnumerable<PropertyDef> properties)
 {
     return properties.SequenceEqual(game.CustomProperties);
 }
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:4,代码来源:GamesRepository.cs

示例11: HasArgumentsForConstructor

 internal static FakeOptions HasArgumentsForConstructor(this IArgumentConstraintManager<FakeOptions> scope, IEnumerable<object> argumentsForConstructor)
 {
     return scope.Matches(x => argumentsForConstructor.SequenceEqual(x.ArgumentsForConstructor), "Constructor arguments ({0})".FormatInvariant(string.Join(", ", argumentsForConstructor.Select(x => x.ToString()).ToArray())));
 }
开发者ID:wenyanw,项目名称:FakeItEasy,代码行数:4,代码来源:FakeOptionsConstraints.cs

示例12: FakeCallToSerializer

 private IReturnValueConfiguration<string> FakeCallToSerializer(IEnumerable<dynamic> expectedArgument)
 {
     return A.CallTo(() => serializer.Serialize(arrayOfObjects)).WhenArgumentsMatch(x => expectedArgument.SequenceEqual((IEnumerable<dynamic>)x[0]));
 }
开发者ID:vladikk,项目名称:SQL2JSON,代码行数:4,代码来源:DataTableToJsonConverterTests.cs

示例13: IsEqualToParentState

 private static bool IsEqualToParentState(NodeInterface node, IEnumerable<int> state)
 {
     return node != null && state.SequenceEqual(((GameNode) node).Tiles);
 }
开发者ID:katuuung,项目名称:Kursovaya,代码行数:4,代码来源:GameSuccessorNodesCalculationRuleBase.cs

示例14: GetServicesShouldReturnExpectedObjects

        public void GetServicesShouldReturnExpectedObjects( IReadOnlyList<Tuple<Type, string, object>> services, Type serviceType, IEnumerable<object> expected )
        {
            // arrange
            var serviceProvider = new ServiceProviderAdapter(
                ( t, s ) => services.Where( i => i.Item1 == t && i.Item2 == s ).Select( i => i.Item3 ).FirstOrDefault(),
                ( t, s ) => services.Where( i => i.Item1 == t && i.Item2 == s ).Select( i => i.Item3 ) );

            // act
            var actual = serviceProvider.GetServices( serviceType );

            // assert
            Assert.True( expected.SequenceEqual( actual ) );
        }
开发者ID:WaffleSquirrel,项目名称:More,代码行数:13,代码来源:ServiceProviderAdapterTest.cs

示例15: _matchInOrderWithTitles

 private static bool _matchInOrderWithTitles(List<Book> books, IEnumerable<string> titles)
 {
     return titles.SequenceEqual(books.Select(b => b.Title));
 }
开发者ID:Blueyiota,项目名称:SpecFlow-Examples,代码行数:4,代码来源:BookAssertions.cs


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