Inheritance: INodeConfiguration
        public void CannotAddSecondMasterTest()
        {
            var nodes = CreateNodes(NodesCount);
            var nodesColection = new NodeCollection(nodes);

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

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