Exemple #1
0
        public void CashedStoragePostCommandNotCompleted()
        {
            var cache     = new CachedDataAccessor(this._dataDriver);
            var beforeRun = cache.PostDataAsync(new EntityMetadata {
                StartAddress = 1000
            }, new Byte[] { 1, 2, 3, 5 },
                                                new CancellationToken()).IsCompleted;

            cache.PostDataAsync(new EntityMetadata {
                StartAddress = 1000
            }, new Byte[] { 1, 2, 3, 5 },
                                new CancellationToken()).RunSynchronously();
            beforeRun.Should().Be(false);
        }
Exemple #2
0
        public void CashedStorageGetCommandNotFailed()
        {
            var cache = new CachedDataAccessor(this._dataDriver);

            cache.PostDataAsync(null, null,
                                new CancellationToken()).IsFaulted.Should().Be(false);
        }
Exemple #3
0
        public void CashedStoragePostCommandAndThenReadInformationFromCache()
        {
            var cache = new CachedDataAccessor(this._dataDriver);

            cache.PostDataAsync(new EntityMetadata {
                StartAddress = 1000
            }, new Byte[] { 1, 2, 3, 5 },
                                new CancellationToken()).RunSynchronously();
            cache.GetDataAsync(new EntityMetadata {
                StartAddress = 1000, NumberOfPoints = 10
            },
                               new CancellationToken()).RunSynchronously();
        }