public void testEnumUInt1() { instanceEnumUInt = EnumUInt.V3; staticEnumUInt = EnumUInt.V2; var local = EnumUInt.V2; AssertTrue(instanceEnumUInt == EnumUInt.V3); AssertTrue(staticEnumUInt == EnumUInt.V2); AssertTrue(local == EnumUInt.V2); var arr = new EnumUInt[1]; arr[0] = EnumUInt.V2; AssertTrue(arr[0] == EnumUInt.V2); }
public async Task EnumUIntTestAsync(EnumUInt 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 { EnumUInt = value }); Assert.Equal(1L, testModel.EnumUInt == value ? result.MatchedCount : result.ModifiedCount); var modifyModel = collection.AsQueryable().First(p => p.Id == testModel.Id); Assert.Equal(value, modifyModel.EnumUInt); Assert.Equal(1L, (await collection.DeleteOneAsync(t => t.Id == testModel.Id)).DeletedCount); }
public EnumCastBenchmark() { _enumInt = (EnumInt)CreateRandomUint(); _enumUInt = (EnumUInt)CreateRandomUint(); }