コード例 #1
0
        public async Task Int_DuplicateTryAddStateAsyncTest()
        {
            var instance = new MockActorStateManager();
            await instance.TryAddStateAsync("existing", 6);

            var result = await instance.TryAddStateAsync("existing", 6);

            Assert.IsFalse(result);
        }
コード例 #2
0
        public async Task Int_TryGetStateAsyncTest()
        {
            var instance = new MockActorStateManager();
            await instance.TryAddStateAsync("existing", 6);

            var result = await instance.TryGetStateAsync <int>("existing");

            Assert.IsInstanceOfType(result, typeof(ConditionalValue <int>));
            Assert.IsNotNull(result.Value);
            Assert.IsTrue(result.HasValue);
            Assert.AreEqual(6, result.Value);
        }