public void CashedStorageGetCommandShouldBeNotCanceled() { var cache = new CachedDataAccessor(this._dataDriver); Task.Factory.StartNew( () => cache.GetDataAsync(Mock.Of <EntityMetadata>(x => x.StartAddress == 0x1000), new CancellationToken())).IsCanceled.Should().Be(false); }
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(); }