Example #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);
        }
Example #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);
            }
        }
Example #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);
 }