Exemplo n.º 1
0
        public void UpdateStatusBroadcastsNewStatus()
        {
            var statuses = new EventSink <DataStoreStatus>();

            updates.StatusChanged += statuses.Add;

            var expectedStatus = new DataStoreStatus
            {
                Available     = false,
                RefreshNeeded = true
            };

            updates.UpdateStatus(expectedStatus);

            var newStatus = statuses.ExpectValue();

            Assert.Equal(expectedStatus, newStatus);
            statuses.ExpectNoValue();
        }
        public void Status()
        {
            Assert.Equal(new DataStoreStatus {
                Available = true, RefreshNeeded = false
            },
                         _dataStoreStatusProvider.Status);

            var status1 = new DataStoreStatus {
                Available = false, RefreshNeeded = false
            };

            _dataStoreUpdates.UpdateStatus(status1);

            Assert.Equal(status1, _dataStoreStatusProvider.Status);

            var status2 = new DataStoreStatus {
                Available = false, RefreshNeeded = true
            };

            _dataStoreUpdates.UpdateStatus(status2);

            Assert.Equal(status2, _dataStoreStatusProvider.Status);
        }