Пример #1
0
        public void Dynamic_Implementation_BaseValueInterface_With_Read_Write_Has_Hardcoded_Snapshot()
        {
            var dynamicEntity = EntityDynamic <ICommonDirectoryBaseValues> .Create();

            var commonDirectory = dynamicEntity.Value;

            commonDirectory.TestDirectory.TestBool    = !commonDirectory.TestDirectory.TestBool;
            commonDirectory.TestDirectory.TestDouble += 23;
            commonDirectory.TestDirectory.TestInt    += 23;
            commonDirectory.TestDirectory.TestString  = $"{commonDirectory.TestDirectory.TestString}TestString";
            commonDirectory.TestDirectory.TestList.Add(1);
            commonDirectory.TestDirectory.TestList.Add(10);
            commonDirectory.TestDirectory.TestList.Add(15);
            Assert.Equal(
                EntityTest.GetCommonDirectoryHardcodedDebugString(),
                dynamicEntity.Changes.Snapshot().ToDebugStringList());
        }
Пример #2
0
        public void Dynamic_Implementation_EntityValueInterface_With_Read_Write_Has_Hardcoded_Snapshot()
        {
            var dynamicEntity = EntityDynamic <ICommonDirectoryEntityValues> .Create();

            var commonDirectory = dynamicEntity.Value;

            commonDirectory.TestDirectory.Value.TestBool.OnNext(!commonDirectory.TestDirectory.Value.TestBool.Value);
            commonDirectory.TestDirectory.Value.TestDouble.OnNext(commonDirectory.TestDirectory.Value.TestDouble.Value + 23);
            commonDirectory.TestDirectory.Value.TestInt.OnNext(commonDirectory.TestDirectory.Value.TestInt.Value + 23);
            commonDirectory.TestDirectory.Value.TestString.OnNext($"{commonDirectory.TestDirectory.Value.TestString.Value}TestString");
            commonDirectory.TestDirectory.Value.TestList.Add(EntitySubject <int> .Create(1));
            commonDirectory.TestDirectory.Value.TestList.Add(EntitySubject <int> .Create(10));
            commonDirectory.TestDirectory.Value.TestList.Add(EntitySubject <int> .Create(15));
            Assert.Equal(
                EntityTest.GetCommonDirectoryHardcodedDebugString(),
                dynamicEntity.Changes.Snapshot().ToDebugStringList());
        }
Пример #3
0
        public void Dynamic_Implementation_SubjectValueInterface_With_Read_Write_Has_Hardcoded_Snapshot()
        {
            var dynamicEntity = EntityDynamic <ICommonDirectorySubjectValues> .Create();

            var commonDirectory = dynamicEntity.Value;
            var testDirectory   = commonDirectory.TestDirectory.FirstAsync().Wait();

            testDirectory.TestBool.OnNext(!testDirectory.TestBool.FirstAsync().Wait());
            testDirectory.TestDouble.OnNext(testDirectory.TestDouble.FirstAsync().Wait() + 23);
            testDirectory.TestInt.OnNext(testDirectory.TestInt.FirstAsync().Wait() + 23);
            testDirectory.TestString.OnNext($"{testDirectory.TestString.FirstAsync().Wait()}TestString");
            var testList = testDirectory.TestList.FirstAsync().Wait();

            testList.Add(1);
            testList.Add(10);
            testList.Add(15);

            Assert.Equal(
                EntityTest.GetCommonDirectoryHardcodedDebugString(),
                dynamicEntity.Changes.Snapshot().ToDebugStringList());
        }