Inheritance: Text
Example #1
0
			public Expectation(Name expectedName, LeafIndex expectedLeafIndex)
			{
				Contract.Requires(expectedName != null);

				ExpectedName = expectedName;
				ExpectedLeafIndex = expectedLeafIndex;
			}
        public void Two_objects_with_the_same_names_should_be_equal(string lastName, string firstName)
        {
            var nameInstanceOne = new Name(lastName, firstName);
            var nameInstanceTwo = new Name(lastName, firstName);

            Assert.Equal(nameInstanceOne, nameInstanceTwo);
        }
 public void NullForCtorArgumentsThrowsException(IFixture fixture, Name name)
 {
     fixture.Inject<IParameter>(new ParameterTest());
     fixture.Inject<ParameterMeta>(ParameterMeta.Create<IParameter>(name));
     var assertion = new GuardClauseAssertion(fixture);
     assertion.Verify(typeof(CmdApplicationConfiguration).GetConstructors());
 }
Example #4
0
 public void SutWithSameValuesAreEqual(Name name)
 {
     var aParameter = new NameOnlyParameter(name);
     var anotherParameter = new NameOnlyParameter(name);
     Assert.Equal(aParameter, anotherParameter);
     Assert.Equal(aParameter.GetHashCode(), anotherParameter.GetHashCode());
 }
Example #5
0
        public static IEnumerable<Pair<Name, Name>> GetTerms(Name n1, Name n2, bool allowPartial)
        {
            if (!(allowPartial || n1.NumberOfTerms == n2.NumberOfTerms))
                return null;

            return n1.GetTerms().Zip(n2.GetTerms(), Tuples.Create);
        }
Example #6
0
 /// <summary>
 /// constructor accepting a string for the key
 /// </summary>
 /// <param name="type"></param>
 /// <param name="name"></param>
 /// <param name="keyString"></param>
 public SecurityKey(Type type, Name name, string keyString)
 {
     KeyBytes = Util.StringToByteArray(keyString);
     KeyString = keyString;
     KeyName = name;
     KeyType = type;
 }
 public void CtorParametersAreInitialized(IFixture fixture, Name name)
 {
     fixture.Inject<IParameter>(new ParameterTest());
     fixture.Inject<ParameterMeta>(ParameterMeta.Create<IParameter>(name));
     var assertion = new ConstructorInitializedMemberAssertion(fixture);
     assertion.Verify(typeof(CmdApplicationConfiguration));
 }
		internal NodeStatusRequest(Name name)
		{
			QuestionName = name;
			QuestionType = Nbstat;
			IsRecurDesired = false;
			IsBroadcast = false;
		}
 public override BaseEvent SwapPerspective(Name oldPerspective, Name newPerspective)
 {
     Action = Action.SwapTerms(oldPerspective, newPerspective);
     Target = Target.SwapTerms(oldPerspective, newPerspective);
     base.SwapPerspective(oldPerspective, newPerspective);
     return this;
 }
Example #10
0
		public static Brush getBrush(Name name, int num = 4)
		{
			var converter = new System.Windows.Media.BrushConverter();

			switch(name)
			{
				case Name.Red:			return (Brush)converter.ConvertFromString(RED[num]);
				case Name.Pink:			return (Brush)converter.ConvertFromString(PINK[num]);
				case Name.Purple:		return (Brush)converter.ConvertFromString(PURPLE[num]);
				case Name.DeepPurple:	return (Brush)converter.ConvertFromString(DEEP_PURPLE[num]);
				case Name.Indigo:		return (Brush)converter.ConvertFromString(INDIGO[num]);
				case Name.Blue:			return (Brush)converter.ConvertFromString(BLUE[num]);
				case Name.LightBlue:	return (Brush)converter.ConvertFromString(LIGHT_BLUE[num]);
				case Name.Cyan:			return (Brush)converter.ConvertFromString(CYAN[num]);
				case Name.Teal:			return (Brush)converter.ConvertFromString(TEAL[num]);
				case Name.Green:		return (Brush)converter.ConvertFromString(GREEN[num]);
				case Name.LightGreen:	return (Brush)converter.ConvertFromString(LIGHT_GREEN[num]);
				case Name.Lime:			return (Brush)converter.ConvertFromString(LIME[num]);
				case Name.Yellow:		return (Brush)converter.ConvertFromString(YELLOW[num]);
				case Name.Amber:		return (Brush)converter.ConvertFromString(AMBER[num]);
				case Name.Orange:		return (Brush)converter.ConvertFromString(ORANGE[num]);
				case Name.DeepOrange:	return (Brush)converter.ConvertFromString(DEEP_ORANGE[num]);
				case Name.Brown:		return (Brush)converter.ConvertFromString(BROWN[num]);
				case Name.Grey:			return (Brush)converter.ConvertFromString(GREY[num]);
				case Name.BlueGrey:		return (Brush)converter.ConvertFromString(BLUE_GREY[num]);
				case Name.Black:		return (Brush)converter.ConvertFromString("#FF000000");
			}

			return (Brush)converter.ConvertFromString("#FFFFFFFF");
		}
Example #11
0
		public FormalTypeParam(Position position, Name name, object defaultType, List<CustomAttribute> attributes)
			: base(position)
		{
			this.name = name;
			this.defaultType = defaultType;
			this.attributes = new CustomAttributes(attributes);
		}
 public AppraisalRule(Name eventName, ConditionSet conditions = null)
 {
     m_id = Guid.NewGuid();
     EventName = eventName;
     Conditions = conditions ?? new ConditionSet();
     Desirability = Praiseworthiness = 0;
 }
 private string GetNameByEnum(Name name)
 {
     string result;
     switch (name)
     {
         case Name.DCS:
             result = "DCS";
             break;
         case Name.班次:
             result = "班次";
             break;
         case Name.报警周期:
             result = "报警周期";
             break;
         case Name.电表:
             result = "电表";
             break;
         case Name.峰谷平:
             result = "峰谷平";
             break;
         case Name.公共公式:
             result = "公共公式";
             break;
         case Name.公式:
             result = "公式";
             break;
         case Name.水泥品种:
             result = "水泥品种";
             break;
         default:
             result = "";
             break;
     }
     return result;
 }
Example #14
0
 /* Also illustrates some String methods.
 */
 public static void Main()
 {
     Name aName = new Name("Henry", "Johnson");
     Address anAddress =
     new Address("1512 Harbor Blvd.", "Long Beach",
                         "CA", "99919");
     Console.Write("Enter an id string: ");
     String anId = Console.ReadLine();
     Person aPerson = new Person(anId,aName,anAddress);
     Console.WriteLine("Our person is ");
     Console.WriteLine(aPerson);
     Console.WriteLine("   with id {0}", aPerson.GetId());
     Console.WriteLine
        ("\n And now some tests using string methods");
     String address = anAddress.ToString();
     int i = address.IndexOf("Harbor");
     Console.WriteLine
        ("The index of Harbor in address is {0}", i);
     String z1 = "99919";
     int lenth = address.Length;
     Console.WriteLine("The length of address is {0}", l);
     String z2 = address.Substring(lenth-5,5);
     bool same = z2.Equals(z1);
     Console.WriteLine
         ("These two zip codes are the same? {0}", same);
     int less = z1.CompareTo("Harbor");
     Console.WriteLine("Compare returns {0}", less);
     String hat = "   hat   ";
     Console.WriteLine(hat+"rack");
     Console.WriteLine(hat.Trim() + "rack");
 }
Example #15
0
 public void WriteQuestion(Name name, RecordType qtype, RecordClass qclass = RecordClass.Internet)
 {
     WriteName(name);
     WriteUInt16((ushort)qtype);
     WriteUInt16((ushort)qclass);
     _questionCount++;
 }
 public override BaseEvent SwapPerspective(Name oldPerspective, Name newPerspective)
 {
     Property = Property.SwapTerms(oldPerspective, newPerspective);
     NewValue = NewValue.SwapTerms(oldPerspective, newPerspective);
     base.SwapPerspective(oldPerspective, newPerspective);
     return this;
 }
        public void Be_Able_To_Parse_A_Given_Line_To_A_Name_Model()
        {
            var expected = new Name
            {
                MutKod = MutKod.RecordNotChanged,
                NmNr = 2,
                NmMemo = "ABBOI2",
                NmEtiket = "ABBOKINASE 250.000IE INJPDR",
                NmNm40 = "ABBOKINASE",
                NmNaam = "ABBOKINASE INJECTIEPOEDER FLACON 250.000IE"
            };

            const string data =
                @"002000000002ABBOI2ABBOKINASE 250.000IE INJPDRABBOKINASE                              ABBOKINASE INJECTIEPOEDER FLACON 250.000IE        0000000000000000000000000";

            byte[] dataBytes = Encoding.UTF8.GetBytes(data);
            var memoryStream = new MemoryStream(dataBytes);
            var serializer = new GStandardFileSerializer<Name>();
            var lines = serializer.ReadLines(memoryStream);

            var model = lines.FirstOrDefault();
            Assert.IsNotNull(model);
            Assert.AreEqual(expected.MutKod, model.MutKod);
            Assert.AreEqual(expected.NmEtiket, model.NmEtiket);
            Assert.AreEqual(expected.NmMemo, model.NmMemo);
            Assert.AreEqual(expected.NmNaam, model.NmNaam);
            Assert.AreEqual(expected.NmNm40, model.NmNm40);
            Assert.AreEqual(expected.NmNr, model.NmNr);
        }
Example #18
0
 private FixedSchema(Name name, int size, Names names)
     : base(Type.FIXED, name, names)
 {
     if (size <= 0) throw new ArgumentOutOfRangeException("size", "size must be greater than zero.");
     
     this.size = size;
 }
Example #19
0
 public Name ConcatenateIdentifier(string identifier)
 {
     var name = new Name();
     name.identifiers = new string[this.identifiers.Length + 1];
     this.identifiers.CopyTo(name.identifiers, 0);
     name.identifiers[this.identifiers.Length] = identifier;
     return name;
 }
Example #20
0
 public Name Concatenate(Name other)
 {
     var name = new Name();
     name.identifiers = new string[this.identifiers.Length + other.identifiers.Length];
     this.identifiers.CopyTo(name.identifiers, 0);
     other.identifiers.CopyTo(name.identifiers, this.identifiers.Length);
     return name;
 }
        public void RegistDynamicProperty(Name propertyName, DynamicPropertyCalculator_T4 surrogate, string description = null)
        {
            if (surrogate == null)
                throw new ArgumentNullException(nameof(surrogate));

            internal_RegistDynamicProperty(propertyName, description, surrogate.GetMethodInfo(),
                (context, args) => surrogate(context, args[0], args[1], args[2], args[3]));
        }
Example #22
0
 public Program()
 {
     names[0] = new Name("Joe", "Mayo");
     names[1] = new Name("John", "Hancock");
     names[2] = new Name("Jane", "Doe");
     names[3] = new Name("John", "Doe");
     names[4] = new Name("Jack", "Smith");
 }
        public void Each_value_has_a_unique_representation()
        {
            var sallySmith = new Name("Sally", "Smith");
            Assert.AreEqual("firstName:Sally;;surname:Smith", sallySmith.ToString());

            var billyJean = new Name("Billy", "Jean");
            Assert.AreEqual("firstName:Billy;;surname:Jean", billyJean.ToString());
        }
 protected BaseEvent(uint id, Name eventName, ulong timestamp)
 {
     Id = id;
     Type = eventName.GetNTerm(1);
     Subject = eventName.GetNTerm(2);
     Timestamp = timestamp;
     EventName = eventName;
 }
Example #25
0
 public SimpleDelegate()
 {
     names[0] = new Name("Joe", "Mayo");
     names[1] = new Name("John", "Hancock");
     names[2] = new Name("Jane", "Doe");
     names[3] = new Name("John", "Doe");
     names[4] = new Name("Jack", "Smith");
 }
 private ContactWithAddressDto(Guid contactId, Name contactName, Address address, string source)
 {
     ContactId = contactId;
       FirstName = contactName.FirstName;
       LastName = contactName.LastName;
       PrimaryAddress = address;
       Source = source;
 }
 public IEnumerable<Pair<Name, SubstitutionSet>> Retrive(IQueryable db, Name perspective, IEnumerable<SubstitutionSet> constraints)
 {
     foreach (var pair in db.AskPossibleProperties(m_name, perspective, constraints))
     {
         foreach (var s in pair.Item2)
             yield return Tuples.Create(pair.Item1, s);
     }
 }
Example #28
0
        public bool Equals(Name other)
        {
            if (other == null) return false;

            if (ReferenceEquals(this, other)) return true;

            return other.FirstName == FirstName && other.LastName == LastName;
        }
 private static void SetNameDetails(Name name)
 {
     if (name.NameType == null)
     {
         name.NameType = (byte)NameType.Company;
         name.NameReference = "Test";
     }
 }
Example #30
0
 private Order(string firstName, string lastName, Address contactAddress, string source)
     : this(null)
 {
     Customer = Customer.CreateFromContact(Guid.Empty, contactAddress);
       _events.Add(new OrderCreatedWithNoExistingContact());
       SetShippingAddress(contactAddress);
       NewContactCustomerName = new Name(firstName, lastName);
       NewContactSource = source;
 }
Example #31
0
        public string CreatePassword()
        {
            string name = Name.Replace(" ", "");

            return(name.ToLower());
        }
Example #32
0
 ///<summary>Spawn an object of this class</summary>
 public static MeshEditorSettings New(UObject obj = null, Name name = new Name()) => Main.NewObject(StaticClass, obj, name);
Example #33
0
 public override int GetHashCode()
 {
     return(Name.GetHashCode());
 }
Example #34
0
 ///<summary>Spawn an object of this class</summary>
 public static PoseWatch New(UObject obj = null, Name name = new Name()) => Main.NewObject(StaticClass, obj, name);
Example #35
0
 public override int GetHashCode()
 {
     return(Name != null ? Name.GetHashCode() : 0);
 }