Skip to content
Snippets Groups Projects
Select Git revision
  • d2acabe796b8be186e9680d35110d82beb2facfd
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

NetworkFollowerStatusProvider.swift

Blame
  • network_test.go 1.22 KiB
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2021 Privategrity Corporation                                   /
    //                                                                             /
    // All rights reserved.                                                        /
    ////////////////////////////////////////////////////////////////////////////////
    
    package params
    
    import "testing"
    
    // New params path
    func TestGetNetworkParameters(t *testing.T) {
    	p := GetDefaultNetwork()
    
    	expected := p.MaxCheckedRounds + 1
    	p.MaxCheckedRounds = expected
    	jsonString, err := p.Marshal()
    	if err != nil {
    		t.Errorf("%+v", err)
    	}
    
    	q, err := GetNetworkParameters(string(jsonString))
    	if err != nil {
    		t.Errorf("%+v", err)
    	}
    
    	if q.MaxCheckedRounds != expected {
    		t.Errorf("Parameters failed to change! Got %d, Expected %d", q.MaxCheckedRounds, expected)
    	}
    }
    
    // No new params path
    func TestGetNetworkParameters_Default(t *testing.T) {
    	p := GetDefaultNetwork()
    
    	q, err := GetNetworkParameters("")
    	if err != nil {
    		t.Errorf("%+v", err)
    	}
    
    	if q.MaxCheckedRounds != p.MaxCheckedRounds {
    		t.Errorf("Parameters failed to change! Got %d, Expected %d", q.MaxCheckedRounds, p.MaxCheckedRounds)
    	}
    }