public void op_Format_int_int() { const string expected = "CavityHttpClient/1.0 (+http://code.google.com/p/cavity/)"; var actual = UserAgent.Format(1, 0); Assert.Equal(expected, actual); }
public void op_Format() { var expected = "CavityHttpClient/{0}.{1} (+http://code.google.com/p/cavity/)".FormatWith( Assembly.GetExecutingAssembly().GetName().Version.Major, Assembly.GetExecutingAssembly().GetName().Version.Minor); var actual = UserAgent.Format(); Assert.Equal(expected, actual); }
public void prop_Value() { Assert.True(new PropertyExpectations <UserAgent>(p => p.Value) .TypeIs <string>() .DefaultValueIs(UserAgent.Format()) .ArgumentNullException() .Set("value") .IsNotDecorated() .Result); }
public void prop_UserAgent() { try { var locator = new Mock <IServiceLocator>(); ServiceLocator.SetLocatorProvider(() => locator.Object); Assert.True(new PropertyExpectations <HttpClient>(p => p.UserAgent) .TypeIs <string>() .DefaultValueIs(UserAgent.Format()) .IsNotDecorated() .Result); locator.VerifyAll(); } finally { ServiceLocator.SetLocatorProvider(null); } }