Exemple #1
0
        public void IsConnected_ReturnsTrue_WhenNetworkAccessIsInternet()
        {
            // Arrange
            var connectivityMock = new ConnectivityMock();

            connectivityMock.SetNetworkAccess(NetworkAccess.Internet);

            // Act
            var connectivityService = new ConnectivityService(connectivityMock);

            // Assert
            Assert.True(connectivityService.IsConnected);
        }
Exemple #2
0
        public void IsConnected_ReturnsFalse_WhenNetworkAccessIsNone()
        {
            // Arrange
            var connectivityMock = new ConnectivityMock();

            connectivityMock.SetNetworkAccess(NetworkAccess.None);

            // Act
            var connectivityService = new ConnectivityService(connectivityMock);

            // Assert
            Assert.False(connectivityService.IsConnected);
        }