Ejemplo n.º 1
0
        public void CanGenerateChildProperty()
        {
            var value = Fake.Create <EnhancementEffect>();

            Assert.NotNull(value.Effect);
            Assert.NotEqual(0, value.Effect.Aspect);
        }
Ejemplo n.º 2
0
        public void CanGenerateEffect()
        {
            var value = Fake.Create <Effect>();

            Assert.Equal(14, value.Aspect);
            Assert.Equal("MagnitudeExpression", value.MagnitudeExpression);
            Assert.Equal(3f, value.Magnitude);
            Assert.False(value.IgnoreEnhancementDiversification);
        }
Ejemplo n.º 3
0
        public void CanGenerateArrayProperty()
        {
            var value = Fake.Create <Requirement>();

            Assert.NotNull(value.ClassNames);
            Assert.Equal(2, value.ClassNames.Length);
            Assert.Equal("0", value.ClassNames[0]);
            Assert.Equal("1", value.ClassNames[1]);
        }
Ejemplo n.º 4
0
        public void CanReadEffect()
        {
            var effect = Fake.Create <Effect>();

            new ReaderTest(setup: (writer) =>
            {
                new EffectWriter(writer).Write(effect);
            },
                           test: (reader) =>
            {
                var record = new EffectReader(reader).Read();
                Assert.Equal(effect, record);
            }).Run();
        }
Ejemplo n.º 5
0
        public void CanReadEnhancement()
        {
            var enhancement = Fake.Create <Enhancement>();

            new ReaderTest(
                setup: (writer) =>
            {
                new EnhancementWriter(writer).Write(enhancement);
            },
                test: (reader) =>
            {
                var record = new EnhancementReader(reader).Read();
                Assert.Equal(enhancement, record);
            }).Run();
        }
Ejemplo n.º 6
0
        public void CanReadNamedEntity()
        {
            var namedEntity = Fake.Create <NamedEntity>();

            new ReaderTest(
                setup: (writer) =>
            {
                new NamedEntityWriter(writer).Write(namedEntity);
            },
                test: (reader) =>
            {
                var record = new NamedEntityReader(reader).Read();
                Assert.Equal(namedEntity, record);
            }).Run();
        }
Ejemplo n.º 7
0
        public void CanReadEnhancementHeader()
        {
            var header = Fake.Create <EnhancementHeader>();

            new ReaderTest(
                setup: (writer) =>
            {
                new EnhancementHeaderWriter(writer).Write(header);
            },
                test: (reader) =>
            {
                var record = new EnhancementHeaderReader(reader).Read();
                Assert.Equal(header, record);
            }).Run();
        }
        public void CanReadPowerset()
        {
            var powerset = Fake.Create <PowerSet>();

            new ReaderTest(
                setup: (writer) =>
            {
                new PowerSetWriter(writer).Write(powerset);
            },
                test: (reader) =>
            {
                var powersetReader = new PowerSetReader(reader);
                var record         = powersetReader.Read();
                Assert.Equal(powerset, record);
            }).Run();
        }
        public void CanReadVersionData()
        {
            var versionData = Fake.Create <VersionData>();

            new ReaderTest(
                (writer) =>
            {
                new VersionDataWriter(writer)
                .Write(versionData);
            },
                (reader) =>
            {
                var header = new VersionDataReader(reader).Read();
                Assert.Equal(versionData, header);
            }).Run();
        }
Ejemplo n.º 10
0
        public void CanReadHeaderWithDate()
        {
            var issue12Header = Fake.Create <Issue12Header>();

            new ReaderTest(
                setup: (writer) =>
            {
                new Issue12HeaderWriter(writer).Write(issue12Header);
            },
                test: (reader) =>
            {
                var headerReader = new Issue12HeaderReader(reader);
                var header       = headerReader.Read();
                Assert.Equal(issue12Header, header);
            }).Run();
        }
        public void CanReadArchetype()
        {
            var archetype = Fake.Create <Archetype>();

            new ReaderTest(
                setup: (writer) =>
            {
                new ArchetypeWriter(writer).Write(archetype);
            },
                test: (reader) =>
            {
                var archetypeReader = new ArchetypeReader(reader);
                var record          = archetypeReader.Read();
                Assert.Equal(archetype, record);
            }
                ).Run();
        }
Ejemplo n.º 12
0
        public void CanReadPower()
        {
            var power = Fake.Create <Power>();

            new ReaderTest(
                setup: (writer) =>
            {
                var powerWriter = new PowerWriter(writer);
                powerWriter.Write(power);
            },
                test: (reader) =>
            {
                var powerReader = new PowerReader(reader);
                var record      = powerReader.Read();
                Assert.Equal(power, record);
            }).Run();
        }
Ejemplo n.º 13
0
        private void CanReadRecordHeader(string prefix)
        {
            var recordHeader = Fake.Create <RecordHeader>();

            new ReaderTest(
                setup: (writer) =>
            {
                writer.Write(recordHeader.Prefix);
                writer.Write(recordHeader.VersionData.Revision);
                writer.Write(recordHeader.VersionData.RevisionDate.ToBinary());
                writer.Write(recordHeader.VersionData.SourceFile);
                writer.Write(recordHeader.Count);
            },
                test: (reader) =>
            {
                var header = new RecordHeaderReader(reader).Read();
                Assert.Equal(recordHeader, header);
            }).Run();
        }
Ejemplo n.º 14
0
        public void CanReadHeaderWithYearMonthDay()
        {
            var issue12Header = Fake.Create <Issue12Header>();

            new ReaderTest(
                setup: (writer) =>
            {
                writer.Write(issue12Header.Description);
                writer.Write(issue12Header.Version);
                writer.Write(issue12Header.Date.Year);
                writer.Write(issue12Header.Date.Month);
                writer.Write(issue12Header.Date.Day);
                writer.Write(issue12Header.Issue);
            },
                test: (reader) =>
            {
                var headerReader = new Issue12HeaderReader(reader);
                var header       = headerReader.Read();
                Assert.Equal(issue12Header, header);
            }).Run();
        }
Ejemplo n.º 15
0
        public void CanGenerateInt()
        {
            var value = Fake.Create <int>();

            Assert.Equal(0, value);
        }
Ejemplo n.º 16
0
        public void CanGenerateString()
        {
            var value = Fake.Create <string>();

            Assert.Equal(string.Empty, value);
        }
Ejemplo n.º 17
0
        public void CanGenerateBoolean()
        {
            var value = Fake.Create <bool>();

            Assert.False(value);
        }
Ejemplo n.º 18
0
        public void CanGenerateFloat()
        {
            var value = Fake.Create <float>();

            Assert.Equal(0f, value);
        }