Ejemplo n.º 1
0
        public void ServerRoot_CalculatedBaseOnServerIpAndPort()
        {
            var sc = new ServerConfiguration
            {
                ServerIp = IPAddress.Parse("127.0.0.1"),
                BasePort = "80"
            };

            Assert.That(sc.ServerRoot, Is.EqualTo("http://127.0.0.1:80"));
        }
Ejemplo n.º 2
0
        public IdentityProvider(ServerConfiguration config)
        {
			_hashCache = new ConcurrentDictionary<string, SonosIdentifier>();
            _idGen = new ConvertPathsToSha1();

            _hashCache.TryAdd("root", new SonosIdentifier
            {
                Id = "root",
                Path = config.MusicShare
            });
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            _uncompressedId = "\\\\some\\smb\\path";
	        _compressedId = new ConvertPathsToSha1().IdentifierFor(_uncompressedId);

            var backing = new Dictionary<string, SonosIdentifier>
            {
                {_uncompressedId, new SonosIdentifier {Id = _compressedId, Path = "\\\\some\\smb\\path"}}
            };

	        _config = new ServerConfiguration {MusicShare = "\\\\a\\\\b"};
            _provider = new IdentityProvider(_config, backing);
        }
Ejemplo n.º 4
0
	    public IdentityProvider(ServerConfiguration config, IEnumerable<KeyValuePair<string, SonosIdentifier>> backingStore)
			: this(config)
        {
	        if (backingStore == null)
            {
                return;
            }

            foreach (var item in backingStore)
            {
                _hashCache.TryAdd(item.Key, item.Value);
            }
        }
Ejemplo n.º 5
0
		public PlayerWebInterface(ServerConfiguration config)
        {
            _config = config;
        }
Ejemplo n.º 6
0
 public SmapiService(LocalMusicServerFactory localMusicServerFactory, ServerConfiguration config)
 {
     _server = localMusicServerFactory.HostedAt(new Uri(config.BaseUrl + ":" + config.BasePort));
 }
 public TopLevelDirectorySearchProvider(ServerConfiguration config, IFileSystem fs)
 {
     _config = config;
     _fs = fs;
 }
 public ServerRegistrationService(PlayerWebInterface webInterface, ServerConfiguration config)
 {
     _webInterface = webInterface;
     _config = config;
 }