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); }
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); }
public void TestCallSByteMethod() { EnumSByte e = EnumSByte.V1; SByteMethod((sbyte)e); }