public void Equality()
        {
            var client = new FakeFirestoreClient();
            var db1    = FirestoreDb.Create("proj", "db", client);
            var db2    = FirestoreDb.Create("proj", "db", client);
            var db3    = FirestoreDb.Create("proj", "otherdb", client);

            var control = db1.Document("col1/doc1/col2/doc2");
            var equal   = new[]
            {
                db1.Document("col1/doc1/col2/doc2"),
                db2.Document("col1/doc1/col2/doc2"),
                db1.Collection("col1").Document("doc1").Collection("col2").Document("doc2")
            };
            var unequal = new[]
            {
                db1.Document("col1x/doc1/col2/doc2"),
                db1.Document("col1/doc1x/col2/doc2"),
                db1.Document("col1/doc1/col2x/doc2"),
                db1.Document("col1/doc1/col2/doc2x"),
                db3.Document("col1/doc1/col2/doc2"),
                db1.Document("col1/doc1"),
                db1.Document("col2/doc2"),
            };

            EqualityTester.AssertEqual(control, equal, unequal);
        }
Ejemplo n.º 2
0
        public void Equality()
        {
            var control = new FieldPath("a", "b");
            var equal   = new[] { new FieldPath("a", "b"), FieldPath.FromDotSeparatedString("a.b") };
            var unequal = new[] { new FieldPath("a", "c") };

            EqualityTester.AssertEqual(control, equal, unequal);
        }
Ejemplo n.º 3
0
        public void Equality()
        {
            var control = new Timestamp(1, 2);
            var equal   = new[] { new Timestamp(1, 2) };
            var unequal = new[] { new Timestamp(2, 2), new Timestamp(1, 3) };

            EqualityTester.AssertEqual(control, equal, unequal);
            EqualityTester.AssertEqualityOperators(control, equal, unequal);
        }
Ejemplo n.º 4
0
        public void Equality()
        {
            var control = Blob.CopyFrom(new byte[] { 1, 2, 3, 4, 5 });
            var equal   = new[] { Blob.CopyFrom(new byte[] { 1, 2, 3, 4, 5 }) };
            var unequal = new[] { Blob.CopyFrom(new byte[] { 1, 2, 3, 4, 5, 6 }) };

            EqualityTester.AssertEqual(control, equal, unequal);
            EqualityTester.AssertEqualityOperators(control, equal, unequal);
        }
Ejemplo n.º 5
0
        public void Equality()
        {
            var control = new GeoPoint(1.5, 2.5);
            // Equal
            var equal   = new[] { new GeoPoint(1.5, 2.5) };
            var unequal = new[]
            {
                new GeoPoint(2.5, 2.5), // Difference in latitude
                new GeoPoint(1.5, 3.5)  // Difference in longitude
            };

            EqualityTester.AssertEqual(control, equal, unequal);
            EqualityTester.AssertEqualityOperators(control, equal, unequal);
        }