public async Task SingleGrainWriteTransaction() { const int delta = 5; IFaultInjectionTransactionTestGrain grain = this.grainFactory.GetGrain <IFaultInjectionTransactionTestGrain>(Guid.NewGuid()); int original = await grain.Get(); await grain.Add(delta); await grain.Deactivate(); int expected = original + delta; int actual = await grain.Get(); Assert.Equal(expected, actual); }
public virtual async Task SingleGrainWriteTransaction() { const int delta = 5; IFaultInjectionTransactionTestGrain grain = this.grainFactory.GetGrain <IFaultInjectionTransactionTestGrain>(Guid.NewGuid()); int original = await grain.Get(); await grain.Add(delta); await grain.Deactivate(); int expected = original + delta; int actual = await grain.Get(); actual.ShouldBeEquivalentTo(expected); }
public async Task SingleGrainReadTransaction() { const int expected = 5; IFaultInjectionTransactionTestGrain grain = grainFactory.GetGrain <IFaultInjectionTransactionTestGrain>(Guid.NewGuid()); await grain.Set(expected); int actual = await grain.Get(); Assert.Equal(expected, actual); await grain.Deactivate(); actual = await grain.Get(); Assert.Equal(expected, actual); }
public virtual async Task SingleGrainReadTransaction() { const int expected = 5; IFaultInjectionTransactionTestGrain grain = grainFactory.GetGrain <IFaultInjectionTransactionTestGrain>(Guid.NewGuid()); await grain.Set(expected); int actual = await grain.Get(); actual.Should().Be(expected); await grain.Deactivate(); actual = await grain.Get(); actual.Should().Be(expected); }