Esempio n. 1
0
        public void LoadWithoutSaveTest()
        {
            Assert.DoesNotThrow(() => { this.usecase.Load(); });

            this.usecase.Point += 10;
            this.usecase.Save();

            var usecase2 = new PointUseCase.Factory().Create(this.savePath, "key");

            usecase2.Load();
            Assert.AreEqual(10, usecase2.Point);
        }
Esempio n. 2
0
        public void SaveLoadTest()
        {
            this.usecase.Point += 100;
            this.usecase.Save();

            var observer = new TestObserver <int>();
            var usecase2 = new PointUseCase.Factory().Create(this.savePath, "key");

            usecase2.Load();
            usecase2.PointAsObservable.Subscribe(observer);

            Assert.AreEqual(1, observer.OnNextCount);
            Assert.AreEqual(100, observer.OnNextValues[0]);
        }