public async Task Should_Handle_Extented_Values_Wit_hBindable_Entity() { var partitionName = Guid.NewGuid().ToString(); var person = Fakers.CreateFakedPerson().Generate(); //decimal person.Altitude = 1.6666666666666666666666666667M; //float person.BankAmount = 2.00000024F; //enum person.Situation = Situation.Divorced; var tableEntity = new TableEntityBinder <PersonEntity>(person, partitionName, person.PersonId.ToString()); var entityResult = await UpSertAndRetrieve(tableEntity); entityResult.Entity.Altitude.Should().Be(person.Altitude); entityResult.Entity.BankAmount.Should().Be(person.BankAmount); entityResult.Entity.Situation.Should().Be(person.Situation); }
public async Task Should_InsertOrMerge_Bindable_Entity() { var partitionName = Guid.NewGuid().ToString(); var person = Fakers.CreateFakedPerson().Generate(); var tableEntity = new TableEntityBinder <PersonEntity>(person, partitionName, person.PersonId.ToString()); _ = await UpSertAndRetrieve(tableEntity); tableEntity = new TableEntityBinder <PersonEntity>(new PersonEntity() { PersonId = person.PersonId, FirstName = "John Do", BirthDate = DateTime.UtcNow.AddYears(-25) }, partitionName, person.PersonId.ToString()); var entityResult = await MergeAndRetrieve(tableEntity); //Only Nullable value and reference types are preserved in merge operation entityResult.Entity.LastName.Should().Be(person.LastName); entityResult.Entity.Latitude.Should().Be(default);