コード例 #1
0
        public void ThisUpdate_InitialValue()
        {
            MainWindowViewModel vm = new MainWindowViewModel();

            DateTime expected = DateTime.MinValue;
            DateTime actual = vm.ThisUpdate;

            Assert.AreEqual<DateTime>(expected, actual);
        }
コード例 #2
0
        public void Status_InitialValue()
        {
            MainWindowViewModel vm = new MainWindowViewModel();

            string expected = string.Empty;
            string actual = vm.Status;

            Assert.AreEqual<string>(expected, actual);
        }
コード例 #3
0
        public void FormatDomainName()
        {
            MainWindowViewModel vm = new MainWindowViewModel();

            Type t = vm.GetType();

            MethodInfo m = t.GetMethod("FormatDomainName", BindingFlags.Instance | BindingFlags.NonPublic);

            string test = "google.com";
            string expected = "zone \"google.com\" { type master; file \"/etc/bind/zones/db.poison\"; };";
            string actual = (string)m.Invoke(vm, new object[] { (string)test });

            Assert.AreEqual<string>(expected, actual);
        }
コード例 #4
0
        public void GetDomainName_withoutComment()
        {
            MainWindowViewModel vm = new MainWindowViewModel();

            Type t = vm.GetType();

            MethodInfo m = t.GetMethod("GetDomainName", BindingFlags.Instance | BindingFlags.NonPublic);

            string test = "0.0.0.0 google.com";
            string expected = "google.com";
            string actual = (string)m.Invoke(vm, new object[] { (string)test });

            Assert.AreEqual<string>(expected, actual);
        }
コード例 #5
0
        public void Activity_InitialValue()
        {
            MainWindowViewModel vm = new MainWindowViewModel();

            Assert.IsFalse(vm.Activity);
        }