public void SelfLoopedEpsilonNFATest()
        {
            var vertex1 = new NodeViewModel();

            graph.AddVertex(vertex1);

            graph.AddEdge(new EdgeViewModel(vertex1, vertex1)
            {
                IsEpsilon = true
            });

            Assert.AreEqual(FATypeEnum.EpsilonNFA, FAAnalyzer.GetType(graph));
        }
        public void MoreThanOneAcceptingStateTest()
        {
            graph.AddVertex(new NodeViewModel()
            {
                IsFinal = true
            });
            graph.AddVertex(new NodeViewModel()
            {
                IsFinal = true
            });

            Assert.False(FAAnalyzer.GetErrors(graph).Any(e => e == Lang.Errors_SetAccepting));
        }
        public void MoreThanOneInitialStateTest()
        {
            graph.AddVertex(new NodeViewModel()
            {
                IsInitial = true
            });
            graph.AddVertex(new NodeViewModel()
            {
                IsInitial = true
            });

            Assert.False(FAAnalyzer.GetErrors(graph).Any(e => e == Lang.Errors_SetInitial));
        }
        public void ValidGraphTest()
        {
            graph.AddVertex(new NodeViewModel()
            {
                IsFinal = true
            });
            graph.AddVertex(new NodeViewModel()
            {
                IsInitial = true
            });

            Assert.False(FAAnalyzer.GetErrors(graph).Any(e => e == Lang.Errors_SetAccepting));
            Assert.False(FAAnalyzer.GetErrors(graph).Any(e => e == Lang.Errors_SetInitial));
        }
        public void SelfLoopedNFATest()
        {
            var vertex1 = new NodeViewModel();
            var vertex2 = new NodeViewModel();

            graph.AddVertex(vertex1);
            graph.AddVertex(vertex2);

            graph.AddEdge(new EdgeViewModel(vertex1, vertex2)
            {
                TransitionTokensString = "1"
            });
            graph.AddEdge(new EdgeViewModel(vertex1, vertex1)
            {
                TransitionTokensString = "1"
            });

            Assert.AreEqual(FATypeEnum.NFA, FAAnalyzer.GetType(graph));
        }
 public void EmptyGraphTest()
 {
     Assert.AreEqual(FATypeEnum.DFA, FAAnalyzer.GetType(graph));
 }
        public void MissingAcceptingStateTest()
        {
            graph.AddVertex(new NodeViewModel());

            Assert.True(FAAnalyzer.GetErrors(graph).Any(e => e == Lang.Errors_SetAccepting));
        }
 public void EmptyGraphTest()
 {
     Assert.True(FAAnalyzer.GetErrors(graph).Count == 0);
 }