Пример #1
0
        public void testEnumSByte1()
        {
			instanceEnumSByte = EnumSByte.V1;
			staticEnumSByte = EnumSByte.V2;
			var local = EnumSByte.V2;
			
            AssertTrue(instanceEnumSByte == EnumSByte.V1);
            AssertTrue(staticEnumSByte == EnumSByte.V2);
            AssertTrue(local == EnumSByte.V2);

			var arr = new EnumSByte[1];
			arr[0] = EnumSByte.V2;
            AssertTrue(arr[0] == EnumSByte.V2);
        }
Пример #2
0
        public void testEnumSByte1()
        {
            instanceEnumSByte = EnumSByte.V1;
            staticEnumSByte   = EnumSByte.V2;
            var local = EnumSByte.V2;

            AssertTrue(instanceEnumSByte == EnumSByte.V1);
            AssertTrue(staticEnumSByte == EnumSByte.V2);
            AssertTrue(local == EnumSByte.V2);

            var arr = new EnumSByte[1];

            arr[0] = EnumSByte.V2;
            AssertTrue(arr[0] == EnumSByte.V2);
        }
Пример #3
0
        public async Task EnumSByteTestAsync(EnumSByte value)
        {
            var collection = MongoDatabase.GetCollection <TestModel>("TestModel");
            var testModel  = TestModelFactory.GetModel();
            await collection.InsertOneAsync(testModel);

            var result = await collection.UpdateManyAsync(t => t.Id == testModel.Id, () => new TestModel
            {
                EnumSByte = value
            });

            Assert.Equal(1L, testModel.EnumSByte == value ? result.MatchedCount : result.ModifiedCount);
            var modifyModel = collection.AsQueryable().First(p => p.Id == testModel.Id);

            Assert.Equal(value, modifyModel.EnumSByte);
            Assert.Equal(1L, (await collection.DeleteOneAsync(t => t.Id == testModel.Id)).DeletedCount);
        }
Пример #4
0
            public void TestCallSByteMethod()
            {
                EnumSByte e = EnumSByte.V1;

                SByteMethod((sbyte)e);
            }