Exemplo n.º 1
0
        private static FileParameterDescriptor CreateFileParameterDescriptor()
        {
            FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor("id", "alias", 10,
                                                                                          FileParameterDescriptor.FileTypeOptions.Source);

            return(fileParameterDescriptor);
        }
        public void Manager_AddInstance_GetInstance_Simple()
        {
            ParametersManager parametersManager = new ParametersManager();

            FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor("id", "alias", 10, FileParameterDescriptor.FileTypeOptions.Source);

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find("id"), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 3
0
        public void Manager_AddInstance_GetInstance_Simple()
        {
            ParametersManager parametersManager = new ParametersManager();

            FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor("id", "alias", 10, FileParameterDescriptor.FileTypeOptions.Source);

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find("id"), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 4
0
        public void Manager_AddInstance_GetInstance_Advanced()
        {
            ParametersManager parametersManager = new ParametersManager();

            FileParameterDescriptor fileParameterDescriptor = CreateFileParameterDescriptor();

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find("id"), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 5
0
        public void SetPublicProperty()
        {
            Fixture fixture = new Fixture();
            FileParameterDescriptor descriptor1 = fixture.Create <FileParameterDescriptor>();

            var descriptor2 = fixture.Build <FileParameterDescriptor>()
                              .With(x => x.MaxSize, 100)
                              .Create();

            Assert.That(descriptor2.MaxSize, Is.EqualTo(100));
        }
Exemplo n.º 6
0
        public void Manager_AddInstance_GetInstance_AutoFixture_Version2()
        {
            ParametersManager parametersManager = new ParametersManager();

            Fixture fixture = new Fixture();
            FileParameterDescriptor fileParameterDescriptor = fixture.Create <FileParameterDescriptor>();

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find(fileParameterDescriptor.Id), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 7
0
        public void Manager_AddInstance_GetInstance_AutoFixture_Alias()
        {
            // DEMO change .GetAlias
            ParametersManager parametersManager = new ParametersManager();

            Fixture fixture = new Fixture();
            FileParameterDescriptor fileParameterDescriptor = fixture.Create <FileParameterDescriptor>();

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.GetAlias(fileParameterDescriptor.Id), Is.SameAs(fileParameterDescriptor.Alias));
        }
Exemplo n.º 8
0
        public void Manager_AddInstance_GetInstance_AutoFixture_AbstractType()
        {
            // DEMO add IFileData
            ParametersManager parametersManager = new ParametersManager();

            Fixture fixture = new Fixture();
            //..add Register
            FileParameterDescriptor fileParameterDescriptor = fixture.Create <FileParameterDescriptorEx>();

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.GetAlias(fileParameterDescriptor.Id), Is.SameAs(fileParameterDescriptor.Alias));
        }
Exemplo n.º 9
0
        public void Manager_AddInstance_GetInstance_AutoFixture_Version1()
        {
            ParametersManager parametersManager = new ParametersManager();

            Fixture fixture = new Fixture();
            string  id      = fixture.Create <string>();
            string  alias   = fixture.Create <string>();
            int     maxSize = fixture.Create <int>();

            FileParameterDescriptor.FileTypeOptions fileTypeOptions = fixture.Create <FileParameterDescriptor.FileTypeOptions>();

            FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor(id, alias, maxSize, fileTypeOptions);

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find(id), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 10
0
 string CodeLength(FileParameterDescriptor descriptor)
 {
     return descriptor.Id + descriptor.Alias;
 }
Exemplo n.º 11
0
 public void DescriptorTests(FileParameterDescriptor descriptor)
 {
     string code = CodeLength(descriptor);
     Assert.That(code.Length, Is.EqualTo(descriptor.Id.Length + descriptor.Alias.Length));
 }
 private static FileParameterDescriptor CreateFileParameterDescriptor()
 {
     FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor("id", "alias", 10,
         FileParameterDescriptor.FileTypeOptions.Source);
     return fileParameterDescriptor;
 }
        public void Manager_AddInstance_GetInstance_AutoFixture_Version1()
        {
            ParametersManager parametersManager = new ParametersManager();

            Fixture fixture = new Fixture();
            string id = fixture.Create<string>();
            string alias = fixture.Create<string>();
            int maxSize = fixture.Create<int>();
            FileParameterDescriptor.FileTypeOptions fileTypeOptions = fixture.Create<FileParameterDescriptor.FileTypeOptions>();

            FileParameterDescriptor fileParameterDescriptor = new FileParameterDescriptor(id, alias, maxSize, fileTypeOptions);

            parametersManager.AddParameter(fileParameterDescriptor);

            Assert.That(parametersManager.Find(id), Is.SameAs(fileParameterDescriptor));
        }
Exemplo n.º 14
0
 string CodeLength(FileParameterDescriptor descriptor)
 {
     return(descriptor.Id + descriptor.Alias);
 }
Exemplo n.º 15
0
        public void DescriptorTests(FileParameterDescriptor descriptor)
        {
            string code = CodeLength(descriptor);

            Assert.That(code.Length, Is.EqualTo(descriptor.Id.Length + descriptor.Alias.Length));
        }