コード例 #1
0
        public void DefaultImport()
        {
            var test = new StaticDependency
            {
                ImportPath    = "mobx",
                DefaultExport = "Mobx"
            };

            Assert.Equal("import Mobx from 'mobx';", test.ToString());
        }
コード例 #2
0
        public void StarAsImport()
        {
            var test = new StaticDependency
            {
                ImportPath    = "mobx",
                DefaultExport = "Mobx",
                UseStarAs     = true
            };

            Assert.Equal("import * as Mobx from 'mobx';", test.ToString());
        }
コード例 #3
0
        public void SingleImport()
        {
            var test = new StaticDependency
            {
                ImportPath = "mobx",
                Exports    =
                {
                    "observable"
                }
            };

            Assert.Equal("import { observable } from 'mobx';", test.ToString());
        }
コード例 #4
0
        public void TwoImports()
        {
            var test = new StaticDependency
            {
                ImportPath = "mobx",
                Exports    =
                {
                    "observable",
                    "decorate"
                }
            };

            Assert.Equal("import { observable, decorate } from 'mobx';", test.ToString());
        }
コード例 #5
0
        public void DualImport_Default()
        {
            var test = new StaticDependency
            {
                ImportPath    = "react",
                DefaultExport = "React",
                Exports       =
                {
                    "Component"
                }
            };

            Assert.Equal("import React, { Component } from 'react';", test.ToString());
        }