public void TestAddServer_SingleServerMultipleSites( ) { Connector c = new MockConnector( ); c.AddServer( "http://server1/site1" ); c.AddServer( "http://server1/site2" ); c.AddServer( "http://server1/site3" ); Assert.AreEqual( 1, c.GetRepositories( ).Count ); Repository r = c.GetRepositories( )[ "server1" ]; Assert.IsNotNull( r ); Assert.AreEqual( "server1", r.GetId( ) ); string[ ] sites = r.Sites; Assert.IsNotNull( sites ); Assert.AreEqual( 3, sites.Length ); Assert.AreEqual( "http://server1/site1", sites[ 0 ] ); Assert.AreEqual( "http://server1/site2", sites[ 1 ] ); Assert.AreEqual( "http://server1/site3", sites[ 2 ] ); }
public void TestAddServer_MultipleServers( ) { Connector c = new MockConnector( ); c.AddServer( "http://server1/sites/site1" ); c.AddServer( "http://server2/sites/site1" ); c.AddServer( "http://server3/sites/site1" ); Assert.AreEqual( 3, c.GetRepositories( ).Count ); Repository r = c.GetRepositories( )[ "server1" ]; Assert.IsNotNull( r ); Assert.AreEqual( "server1", r.GetId( ) ); r = c.GetRepositories( )[ "server2" ]; Assert.IsNotNull( r ); Assert.AreEqual( "server2", r.GetId( ) ); r = c.GetRepositories( )[ "server3" ]; Assert.IsNotNull( r ); Assert.AreEqual( "server3", r.GetId( ) ); }
public void TestAddServer( ) { Connector c = new MockConnector( ); c.AddServer( "http://lib" ); Assert.AreEqual( 1, c.GetRepositories( ).Count ); Repository r = c.GetRepositories( )[ "lib" ]; Assert.IsNotNull( r ); Assert.AreEqual( "lib", r.GetId() ); string[ ] sites = r.Sites; Assert.IsNotNull( sites ); Assert.AreEqual( 1, sites.Length ); Assert.AreEqual( "http://lib", sites[ 0 ] ); }