Пример #1
0
        public void CreatesNameWithourRidAndEnv()
        {
            var expectValue = "myresource";

            var             context        = new ResourceContext();
            INamingStrategy namingStrategy = new DefaultNamingStrategy(context);
            var             name           = namingStrategy.GenerateName(expectValue);

            name.OutputShould().Be(expectValue);
        }
Пример #2
0
        public void CreatesNameWithEnv()
        {
            var             baseName       = "myresource";
            var             env            = "dev";
            var             expectValue    = $"{baseName}-{env}";
            var             context        = new ResourceContext(null, env);
            INamingStrategy namingStrategy = new DefaultNamingStrategy(context);
            var             name           = namingStrategy.GenerateName(baseName);

            name.OutputShould().Be(expectValue);
        }
Пример #3
0
        public void CreatesNameWithRid()
        {
            var baseName    = "myresource";
            var rid         = "42dh33gh";
            var expectValue = $"{baseName}-{rid}";

            var context = new ResourceContext(rid);

            INamingStrategy namingStrategy = new DefaultNamingStrategy(context);
            var             name           = namingStrategy.GenerateName(baseName);

            name.OutputShould().Be(expectValue);
        }