public void testEnumByte1() { instanceEnumByte = EnumByte.V3; staticEnumByte = EnumByte.V2; var local = EnumByte.V2; AssertTrue(instanceEnumByte == EnumByte.V3); AssertTrue(staticEnumByte == EnumByte.V2); AssertTrue(local == EnumByte.V2); var arr = new EnumByte[1]; arr[0] = EnumByte.V2; AssertTrue(arr[0] == EnumByte.V2); }
public async Task EnumByteTestAsync(EnumByte 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 { EnumByte = value }); Assert.Equal(1L, testModel.EnumByte == value ? result.MatchedCount : result.ModifiedCount); var modifyModel = collection.AsQueryable().First(p => p.Id == testModel.Id); Assert.Equal(value, modifyModel.EnumByte); Assert.Equal(1L, (await collection.DeleteOneAsync(t => t.Id == testModel.Id)).DeletedCount); }
public static byte PassEnumByte(EnumByte e) { return((byte)e); }