コード例 #1
0
        public void PublicObject_WithReadonlyField_IsSuccess()
        {
            var target = new PublicObjectWithReadonlyField(_random.Next());

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }
コード例 #2
0
        public override void Execute(SourceGeneratorContext context)
        {
            var target = new PublicObjectWithDefaultCtor
            {
                Value = new Random().Next()
            };
            var syntax = CacheBuilder.CreateCache(target);

            context.AddCompilationUnit("Test", syntax);
        }
コード例 #3
0
        public void PublicObject_WithPrivateCtor_IsSuccess()
        {
            var target = PublicObjectWithPrivateCtor.Create(_random.Next());

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }
コード例 #4
0
        public void PrivateObject_WithDefaultCtor_IsSuccess()
        {
            var target = new PrivateObjectWithDefaultCtorWrapper();

            target.Intialize(_random.Next());

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }
コード例 #5
0
        public void PublicField_IsSuccess()
        {
            var target = new PublicField();

            target.Value = _random.Next();

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }
コード例 #6
0
        public void PublicObject_WithGenerics_IsSuccess()
        {
            var target = new PublicObjectWithGenerics <int>()
            {
                Value = _random.Next()
            };

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }
コード例 #7
0
        public void Inheritance_IsSuccess()
        {
            var target = new Inheritance()
            {
                BaseValue = _random.Next(),
                Value     = _random.Next()
            };

            var syntax = CacheBuilder.CreateCache(target);

            var syntaxString = syntax.ToString();

            Assert.IsNotNull(syntaxString);
        }