Inheritance: INodeConfiguration
Exemplo n.º 1
0
        public void CannotAddSecondMasterTest()
        {
            var nodes = CreateNodes(NodesCount);
            var nodesColection = new NodeCollection(nodes);

            var master = new NodeConfiguration() {IsMaster = true};

            Assert.Throws<ArgumentException>(() => nodesColection.AddNewNode(master));
        }
Exemplo n.º 2
0
 public void NodeConfiguration_DeclareAsNewMaster_AlreadyMaster_Test()
 {
     var nodeConfiguration = new NodeConfiguration();
     nodeConfiguration.DeclareAsNewMaster();
     nodeConfiguration.DeclareAsNewMaster();
 }
Exemplo n.º 3
0
 public void NodeConfiguration_DeclareAsNewMaster_Success_Test()
 {
     var nodeConfiguration = new NodeConfiguration();
     nodeConfiguration.DeclareAsNewMaster();
     Assert.IsTrue(nodeConfiguration.IsMaster);
 }
Exemplo n.º 4
0
 public bool Equals(NodeConfiguration other)
 {
     if (ReferenceEquals(null, other))
     {
         return false;
     }
     if (ReferenceEquals(this, other))
     {
         return true;
     }
     return other.ServerId == ServerId;
 }