コード例 #1
0
        public IEnumerator B_キーが存在しない場合はFalse()
        {
            PlayerPrefs.SetString(Key + "_", "some value");

            yield return(KeyValueStore
                         .Has(Key)
                         .ToCoroutine(x => Assert.That(x, Is.False)));
        }
コード例 #2
0
        public IEnumerator A_キーが存在する場合はTrue()
        {
            PlayerPrefs.SetString(Key, "some value");

            yield return(KeyValueStore
                         .Has(Key)
                         .ToCoroutine(x => Assert.That(x, Is.True)));
        }
コード例 #3
0
        public IEnumerator Checkerをキャンセル()
        {
            var source = new CancellationTokenSource();

            AsyncChecker.When(x => x.HasAsync(Key, source.Token)).Do(_ => source.Cancel());

            yield return(KeyValueStore.Has(Key, source.Token).ToCoroutine());

            Assert.That(source.IsCancellationRequested, Is.True);
        }
コード例 #4
0
        public IEnumerator 基本メソッド()
        {
            yield return(KeyValueStore
                         .Has(Key)
                         .ToCoroutine(x => Assert.That(x, Is.False)));

            yield return(KeyValueStore
                         .Get(Key, "DefaultValue")
                         .ToCoroutine(x => Assert.That(x, Is.EqualTo("DefaultValue"))));

            yield return(KeyValueStore
                         .Set(Key, "NewValue")
                         .ToCoroutine());

            yield return(KeyValueStore
                         .Has(Key)
                         .ToCoroutine(x => Assert.That(x, Is.True)));

            yield return(KeyValueStore
                         .Get <string>(Key)
                         .ToCoroutine(x => Assert.That(x, Is.EqualTo("NewValue"))));
        }
コード例 #5
0
 public SystemUnderTest WithServerCountSample(ServerCountSample sample)
 {
     KeyValueStore.Has(sample);
     return(this);
 }