示例#1
0
        public void TestCreateSingleItem(Enums.ResourceType resourceType)
        {
            Phase phase = PhaseHelper.CreatePhaseInstance(creatingRequestRecords, resourceType);

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot create phase for {0}", resourceType));
        }
示例#2
0
        public void TestCreateSingleItem(Enums.ResourceType resourceType, LengthType lengthType, Enums.TextType textType)
        {
            Phase phase = PhaseHelper.CreatePhaseInstance(creatingRequestRecords, resourceType);

            phase.Memo = Util.GetRandomText(textType, stringLength[lengthType]);

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot create phase for {0}", resourceType));
        }
示例#3
0
        public void TestUpdateSingleItem(Enums.ResourceType resourceType, LengthType lengthType, Enums.TextType textType)
        {
            var phase = new Phase
            {
                Id   = phaseReader.Data[$"{resourceType.ToPrivateEnum()}{0}"].FirstOrDefault().Id,
                Memo = Util.GetRandomText(textType, stringLength[lengthType]),
            };

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot update phase memo for {0}", resourceType));
        }
        public void TestCreateSingleItem(Enums.ResourceType resourceType, string fieldName, WriteValidInput valueType)
        {
            string fieldValue = FieldValueMapper.ValidInputMapper[valueType];

            Phase phase = PhaseHelper.CreatePhaseInstance(creatingRequestRecords, resourceType);

            phase.DictionaryValues[fieldName] = fieldValue;

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot create phase for {0}", resourceType));
        }
        public void TestUpdateSingleItem(Enums.ResourceType resourceType, string fieldName, WriteValidInput valueType)
        {
            string fieldValue = FieldValueMapper.ValidInputMapper[valueType];

            var phase = new Phase
            {
                Id = phaseReader.Data[$"{resourceType.ToPrivateEnum()}{0}"].FirstOrDefault().Id,
            };

            phase.DictionaryValues[fieldName] = fieldValue;

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot create phase for {0}", resourceType));
        }
示例#6
0
        public void TestUpdateSingleItem(Enums.ResourceType resourceType)
        {
            var resourcePhase = PhaseSearcher.Data.Options.Where(op => op.Alias == $"Option.P_{resourceType.ToResourceName()}Phase").SingleOrDefault();
            var phase         = new Phase
            {
                Id          = phaseReader.Data[$"{resourceType.ToPrivateEnum()}{0}"].FirstOrDefault().Id,
                PhaseObject = new Option()
                {
                    ActualXMLTag = resourcePhase.Children.FirstOrDefault().Alias
                },
            };

            string result = PhaseHelper.WriteResource(phase);

            Assert.That(result, Is.Not.Null.And.Not.Empty, string.Format("Cannot create phase for {0}", resourceType));
        }