ABsoluteMaybe.Tests.Persistence.XmlExperimentCommandsTests.GetOrCreateParticipationRecordDoesNotMarkRecordAsConvertedUponFirstCreation C# (CSharp) Méthode

GetOrCreateParticipationRecordDoesNotMarkRecordAsConvertedUponFirstCreation() private méthode

        public void GetOrCreateParticipationRecordDoesNotMarkRecordAsConvertedUponFirstCreation()
        {
            //arrange
            _commands.Reset();
            const string experimentName = "Troy's Experiment";
            const string assignedOption = "Foo";
            const string userId = "USER_123";
            _commands.GetOrCreateExperiment(experimentName, new[] { "Foo", "Bar" });

            //act
            var result = _commands.GetOrCreateParticipationRecord(experimentName, () => assignedOption, userId);

            //assert
            result.HasConverted.ShouldBeFalse();

            var xml = XDocument.Parse(_commands.SavedXml);
            var exp = xml.Root.Elements("Experiment").Single();

            var record = exp.Element("Participants").Elements("Participant").Single();
            record.Attribute("HasConverted").ShouldBeNull();
            record.Attribute("DateConverted").ShouldBeNull();
        }