Exemplo n.º 1
0
        public void TestZeroLengthOptionsException()
        {
            var haikunator = new Haikunator {
                Adjectives = null, Nouns = null
            };

            Assert.Equal("", haikunator.Haikunate(tokenChars: null));
        }
Exemplo n.º 2
0
        public void AddFieldToNode(Node node, Type type)
        {
            var newField = new Field(Haikunator.Random(), type.FullName);

            node.Fields.Add(newField);
            SaveGraph(GraphData);
            SendNotification(NodeFieldAdded, new Tuple <Node, Field>(node, newField));
        }
Exemplo n.º 3
0
        public void TestReturnsSameForSameSeed()
        {
            const int seed = 1001;

            var h1 = new Haikunator(seed);
            var h2 = new Haikunator(seed);

            Assert.Equal(h1.Haikunate(), h2.Haikunate());
            Assert.Equal(h1.Haikunate(), h2.Haikunate());
        }
Exemplo n.º 4
0
        public void AddNewNode(Vector2 mousePosition)
        {
            var newNode = new Node
            {
                Position = new Rect(mousePosition, new Vector2(Node.DefaultWidth, Node.DefaultHeight)),
                Name     = Haikunator.Random()
            };

            GraphData.Nodes.Add(newNode);
            SaveGraph(GraphData);

            SendNotification(NodeAdded, newNode);
        }