Beispiel #1
0
        public void VerifyThatToDtoThrowsException()
        {
            var name    = "nothing";
            var nothing = new NotThing(name);

            Assert.Throws <NotSupportedException>(() => nothing.ToDto());
        }
Beispiel #2
0
        public void VerifyThatResolvePropertiesThrowsException()
        {
            var name    = "nothing";
            var nothing = new NotThing(name);

            Assert.Throws <NotSupportedException>(() => nothing.ResolveProperties(null));
        }
Beispiel #3
0
        public void VerifyThatGenericCloneThrowsException()
        {
            var name    = "nothing";
            var nothing = new NotThing(name);

            Assert.Throws <NotSupportedException>(() => nothing.Clone(false));
        }
        public void VerifyThatIconIsReturnedForAllClassKindGrayScale()
        {
            var assembly = Assembly.GetAssembly(typeof(Thing));
            var values   = Enum.GetValues(typeof(ClassKind)).Cast <ClassKind>().Select(x => x.ToString()).ToList();

            foreach (var type in assembly.GetTypes())
            {
                if (!values.Contains(type.Name) || type.FullName.Contains("DTO"))
                {
                    continue;
                }

                Thing thing;
                if (type.Name == "NotThing")
                {
                    thing = new NotThing("a");
                }
                else
                {
                    if (type.IsAbstract)
                    {
                        continue;
                    }

                    thing = (Thing)Activator.CreateInstance(type, Guid.NewGuid(), null, null);
                }

                var converterResult = this.converter.Convert(new object[] { thing, RowStatusKind.Inactive }, null, null, null);
                Assert.IsNotNull(converterResult);
            }
        }
Beispiel #5
0
        public void VerifyThatConstructorSetsProperties()
        {
            var name = "nothing";

            var nothing = new NotThing(name);

            Assert.AreEqual(name, nothing.Name);
            Assert.IsNull(nothing.Container);
            Assert.AreEqual(ClassKind.NotThing, nothing.ClassKind);
        }
Beispiel #6
0
        public void VerifyThatTopContainerOfNotThingIsNull()
        {
            var nothing = new NotThing("nothing");

            Assert.IsNull(nothing.TopContainer);
        }
Beispiel #7
0
        public void VerifyThatRouteOfNothingReturnsExpectedString()
        {
            var nothing = new NotThing("nothing");

            Assert.AreEqual("no thing, no route", nothing.Route);
        }
Beispiel #8
0
        public void VerifyThatAnyOtherClassThanEnumerationValueDefinitionGetsConvertedToHyphen()
        {
            var notThing = new NotThing("nothing");

            Assert.AreEqual("-", this.converter.Convert(notThing, null, null, null));
        }