Exemplo n.º 1
0
        public void Test_Savingfile()
        {
            var ipAddresses = new List <string>()
            {
                "192.168.1.1",
                "192.168.1.2"
            };

            DotcoinIpManager.SaveIpAddresses(ipAddresses, DEFAULT_TEST_FILE);

            var fileAddresses = DotcoinIpManager.LoadIpAddresses(DEFAULT_TEST_FILE);

            var pass = fileAddresses.Count == ipAddresses.Count;

            foreach (var address in fileAddresses)
            {
                var sAddress = address.ToString();

                if (!ipAddresses.Contains(sAddress))
                {
                    pass = false;
                }
            }

            Assert.True(pass);
        }
Exemplo n.º 2
0
        private void CreateTestFile()
        {
            if (!File.Exists(DEFAULT_TEST_FILE))
            {
                var ipAddresses = new List <string>()
                {
                    "192.168.1.1"
                };

                DotcoinIpManager.SaveIpAddresses(ipAddresses, DEFAULT_TEST_FILE);
            }
        }
Exemplo n.º 3
0
        public void Test_CreatingFile()
        {
            var ipAddresses = new List <string>()
            {
                "192.168.1.1"
            };

            DotcoinIpManager.SaveIpAddresses(ipAddresses, TEST_CREATE);


            Assert.True(File.Exists(TEST_CREATE));
        }
 private void createIpFile()
 {
     DotcoinIpManager.SaveIpAddresses(_knownIps, TEST_NETWORK_IP_FILE);
 }