public void CompareTo_Null()
        {
            var db       = FirestoreDb.Create("proj", "db", new FakeFirestoreClient());
            var document = db.Document("root/doc");

            ComparisonTester.AssertComparison(null, document);
        }
Пример #2
0
        public void CompareTo_Null()
        {
            var db         = FirestoreDb.Create("proj", "db", new FakeFirestoreClient());
            var collection = db.Collection("root");

            ComparisonTester.AssertComparison(null, collection);
        }
        [InlineData("p1", "d1", "col1/doc2", "p1", "d1", "col2/doc1")] // Collection before document
        // (More details path tests in PathComparerTest)
        public void CompareTo(
            string smallerProject, string smallerDb, string smallerPath,
            string largerProject, string largerDb, string largerPath)
        {
            var client  = new FakeFirestoreClient();
            var smaller = FirestoreDb.Create(smallerProject, smallerDb, client).Document(smallerPath);
            var larger  = FirestoreDb.Create(largerProject, largerDb, client).Document(largerPath);

            ComparisonTester.AssertComparison(smaller, larger);
        }
Пример #4
0
        public void Ordering()
        {
            var paths = new[]
            {
                FieldPath.Empty,
                new FieldPath("a"),
                new FieldPath("a", "b"),
                new FieldPath("a", "b", "b"),
                new FieldPath("a", "b", "ba"),
                new FieldPath("a", "b", "c"),
                new FieldPath("b", "a"),
            };

            for (int i = 0; i < paths.Length; i++)
            {
                for (int j = i + 1; j < paths.Length; j++)
                {
                    // This will also compare field paths with themselves
                    ComparisonTester.AssertComparison(paths[i], paths[j]);
                }
            }
        }
 public void CompareTo(string smaller, string larger) =>
 ComparisonTester.AssertComparison(smaller, larger, PathComparer.Instance);