コード例 #1
0
        public void CheckForUnregisteredProperties()
        {
            //todo: build stackrace or other go to code functionality

            registeredButUntested = testedSpecs.FindAll(s => s.TimesTested == 0);
            if (registeredButUntested.Count != 0)
            {
                StringBuilder message = new StringBuilder();
                registeredButUntested.ConvertAll(s => s.Name)
                    .ForEach(s => message.AppendLine(s));
                try
                {
                    throw new UnregisteredPropertiesException(message.ToString());
                }
                catch (UnregisteredPropertiesException exception)
                {
                    try
                    {
                        throw new SpecFailedException(
                                "Registered Spec not evaluated", exception );
                    }
                    catch (SpecFailedException specFailedException)
                    {
                        failedSpec = specFailedException;
                    }
                }
            }
        }
コード例 #2
0
 public void SpecFailed(SpecFailedException failure)
 {
     //if (!testedSpecs.Exists(p => p.Name == failure.Message))
     //    throw new InvalidOperationException("Specification Not Registered");
     failedSpec = failure;
 }