- //setup - data
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- //setup - expectations
- mock.Expect(x => x.HasInventory(TALISKER, 50)).Returns(true);
-
- //exercise
- order.Fill(mock.Object);
-
- //verify
- Assert.True(order.IsFilled);
-
- The following example shows how to use the
- //setup - data
- var order = new Order(TALISKER, 50);
- var mock = new Mock<IWarehouse>();
-
- //setup - expectations
- //shows how to expect a value within a range
- mock.Expect(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
- //shows how to throw for unexpected calls. contrast with the "verify" approach of other mock libraries.
- mock.Expect(x => x.Remove(
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Throws(new InvalidOperationException());
-
- //exercise
- order.Fill(mock.Object);
-
- //verify
- Assert.False(order.IsFilled);
-
-
- var mock = new Mock<IProcessor>();
- mock.Expect(x => x.Execute("ping"));
-
- // add IDisposable interface
- var disposable = mock.As<IDisposable>();
- disposable.Expect(d => d.Dispose()).Verifiable();
-
-
- mock.Expect(x => x.HasInventory("Talisker", 50)).Returns(true);
-
-
- var mock = new Mock<IProcessor>();
- mock.Expect(x => x.Execute("ping"));
-
-
- mock.ExpectGet(x => x.Suspended)
- .Returns(true);
-
-
- mock.ExpectSet(x => x.Suspended);
-
-
- mock.ExpectSet(x => x.Suspended, true);
-
-
- var mock = new Mock<IProcessor>();
- // exercise mock
- //...
- // Will throw if the test code didn't call Execute with a "ping" string argument.
- mock.Verify(proc => proc.Execute("ping"));
-
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't call HasInventory.
- mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50));
-
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't retrieve the IsClosed property.
- mock.VerifyGet(warehouse => warehouse.IsClosed);
-
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property.
- mock.VerifySet(warehouse => warehouse.IsClosed);
-
-
- var mock = new Mock<IWarehouse>();
- // exercise mock
- //...
- // Will throw if the test code didn't set the IsClosed property to true
- mock.VerifySet(warehouse => warehouse.IsClosed, true);
-
-
- bool called = false;
- mock.Expect(x => x.Execute())
- .Callback(() => called = true);
-
-
- mock.Expect(x => x.Execute(It.IsAny<string>()))
- .Callback((string command) => Console.WriteLine(command));
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2));
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3));
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>(),
- It.IsAny<bool>()))
- .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
-
-
- var mock = new Mock<ICommand>();
- mock.Expect(foo => foo.Execute("ping"))
- .AtMostOnce();
-
-
- var mock = new Mock<ICommand>();
- mock.Expect(foo => foo.Execute("ping"))
- .AtMost( 5 );
-
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true)
- .Verifiable();
-
-
- var mock = new Mock<IContainer>();
- // create handler to associate with the event to raise
- var handler = mock.CreateEventHandler();
- // associate the handler with the event to raise
- mock.Object.Added += handler;
- // set the expectation and the handler to raise
- mock.Expect(add => add.Add(It.IsAny<string>(), It.IsAny<object>()))
- .Raises(handler, EventArgs.Empty);
-
-
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
- }
-
- Now we can invoke this static method instead of an argument in an
- invocation:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Expect(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- Note that the return value from the compiler matcher is irrelevant.
- This method will never be called, and is just used to satisfy the
- compiler and to signal Moq that this is not a method that we want
- to be invoked at runtime.
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
-
- At runtime, the mocked method will be invoked with a specific
- list of orders. This value will be passed to this runtime
- matcher as the first argument, while the second argument is the
- one specified in the expectation (
- public static class Orders
- {
- [Matcher]
- public static IEnumerable<Order> Contains(Order order)
- {
- return null;
- }
-
- public static bool Contains(IEnumerable<Order> orders, Order order)
- {
- return orders.Contains(order);
- }
- }
-
- And the concrete test using this matcher:
-
- var order = new Order { ... };
- var mock = new Mock<IRepository<Order>>();
-
- mock.Expect(x => x.Save(Orders.Contains(order)))
- .Throws<ArgumentException>();
-
- // use mock, invoke Save, and have the matcher filter.
-
-
- mock.ExpectGet(x => x.Suspended)
- .Returns(true);
-
-
- mock.ExpectGet(x => x.Suspended)
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the property
- is retrieved and the value the
- mock.ExpectGet(x => x.Suspended)
- .Callback(() => called = true)
- .Returns(true);
-
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(true);
-
-
- mock.Expect(x => x.Execute("ping"))
- .Returns(() => returnValues[0]);
-
- The lambda expression to retrieve the return value is lazy-executed,
- meaning that its value may change depending on the moment the method
- is executed and the value the
- mock.Expect(x => x.Execute(It.IsAny<string>()))
- .Returns((string command) => returnValues[command]);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Returns((string arg1, string arg2) => arg1 + arg2);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Returns((string arg1, string arg2, int arg3) => arg1 + arg2 + arg3);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>(),
- It.IsAny<bool>()))
- .Returns((string arg1, string arg2, int arg3, bool arg4) => arg1 + arg2 + arg3 + arg4);
-
-
- mock.Expect(x => x.Execute(""))
- .Throws(new ArgumentException());
-
-
- mock.Expect(x => x.Execute(""))
- .Throws<ArgumentException>();
-
-
- bool called = false;
- mock.Expect(x => x.Execute())
- .Callback(() => called = true)
- .Returns(true);
-
- Note that in the case of value-returning methods, after the
- mock.Expect(x => x.Execute(It.IsAny<string>()))
- .Callback((string command) => Console.WriteLine(command))
- .Returns(true);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>()))
- .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2))
- .Returns(true);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>()))
- .Callback((string arg1, string arg2, int arg3) => Console.WriteLine(arg1 + arg2 + arg3))
- .Returns(true);
-
-
- mock.Expect(x => x.Execute(
- It.IsAny<string>(),
- It.IsAny<string>(),
- It.IsAny<int>(),
- It.IsAny<bool>()))
- .Callback((string arg1, string arg2, int arg3, bool arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4))
- .Returns(true);
-
-
- var mock = new Mock<ICommand>();
- mock.Expect(foo => foo.Execute("ping"))
- .Never();
-
-
- mock.ExpectSet(x => x.Suspended)
- .Callback((bool state) => Console.WriteLine(state));
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Expect(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());
-
-
- mock.Expect(x => x.Do(It.Is<int>(i => i % 2 == 0)))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Expect(x => x.GetUser(It.Is<int>(i => i < 0)))
- .Throws(new ArgumentException());
-
-
- mock.Expect(x => x.HasInventory(
- It.IsAny<string>(),
- It.IsInRange(0, 100, Range.Inclusive)))
- .Returns(false);
-
-
- mock.Expect(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);
-
-
- mock.Expect(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1);
-
-
- var mockView = new Mock<IOrdersView>();
- var mockedEvent = mockView.CreateEventHandler<OrderEventArgs>();
-
- var presenter = new OrdersPresenter(mockView.Object);
-
- // Check that the presenter has no selection by default
- Assert.Null(presenter.SelectedOrder);
-
- // Create a mock event handler of the appropriate type
- var handler = mockView.CreateEventHandler<OrderEventArgs>();
- // Associate it with the event we want to raise
- mockView.Object.Cancel += handler;
- // Finally raise the event with a specific arguments data
- handler.Raise(new OrderEventArgs { Order = new Order("moq", 500) });
-
- // Now the presenter reacted to the event, and we have a selected order
- Assert.NotNull(presenter.SelectedOrder);
- Assert.Equal("moq", presenter.SelectedOrder.ProductName);
-
-
- var mockView = new Mock<IOrdersView>();
- var mockedEvent = mockView.CreateEventHandler();
-
- var presenter = new OrdersPresenter(mockView.Object);
-
- // Check that the presenter is not in the "Canceled" state
- Assert.False(presenter.IsCanceled);
-
- // Create a mock event handler of the appropriate type
- var handler = mockView.CreateEventHandler();
- // Associate it with the event we want to raise
- mockView.Object.Cancel += handler;
- // Finally raise the event
- handler.Raise(EventArgs.Empty);
-
- // Now the presenter reacted to the event, and changed its state
- Assert.True(presenter.IsCanceled);
-
-
- var mock = new Mock<IWarehouse>();
- mock.Expect(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory.
- mock.Verify();
-
-
- var mock = new Mock<IWarehouse>();
- mock.Expect(x => x.HasInventory(TALISKER, 50)).Returns(true);
- ...
- // other test code
- ...
- // Will throw if the test code has didn't call HasInventory, even
- // that expectation was not marked as verifiable.
- mock.VerifyAll();
-
-
- // Typed instance, not the mock, is retrieved from some test API.
- HttpContextBase context = GetMockContext();
-
- // context.Request is the typed object from the "real" API
- // so in order to add an expectation to it, we need to get
- // the mock that "owns" it
- Mock<HttpRequestBase> request = Mock.Get(context.Request);
- mock.Expect(req => req.AppRelativeCurrentExecutionFilePath)
- .Returns(tempUrl);
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // no need to call Verifiable() on the expectation
- // as we'll be validating all expectations anyway.
- foo.Expect(f => f.Do());
- bar.Expect(b => b.Redo());
-
- // exercise the mocks here
-
- factory.VerifyAll();
- // At this point all expectations are already checked
- // and an optional MockException might be thrown.
- // Note also that because the mocks are strict, any invocation
- // that doesn't have a matching expectation will also throw a MockException.
-
- The following examples shows how to setup the factory
- to create loose mocks and later verify only verifiable expectations:
-
- var factory = new MockFactory(MockBehavior.Loose);
-
- var foo = factory.Create<IFoo>();
- var bar = factory.Create<IBar>();
-
- // this expectation will be verified at the end of the "using" block
- foo.Expect(f => f.Do()).Verifiable();
-
- // this expectation will NOT be verified
- foo.Expect(f => f.Calculate());
-
- // this expectation will be verified at the end of the "using" block
- bar.Expect(b => b.Redo()).Verifiable();
-
- // exercise the mocks here
- // note that because the mocks are Loose, members
- // called in the interfaces for which no matching
- // expectations exist will NOT throw exceptions,
- // and will rather return default values.
-
- factory.Verify();
- // At this point verifiable expectations are already checked
- // and an optional MockException might be thrown.
-
- The following examples shows how to setup the factory with a
- default strict behavior, overriding that default for a
- specific mock:
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- // this particular one we want loose
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
- var bar = factory.Create<IBar>();
-
- // set expectations
-
- // exercise the mocks here
-
- factory.Verify();
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>();
- // use mock on tests
-
- factory.VerifyAll();
-
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>("Foo", 25, true);
- // use mock on tests
-
- factory.Verify();
-
-
- var factory = new MockFactory(MockBehavior.Strict);
-
- var foo = factory.Create<IFoo>(MockBehavior.Loose);
-
-
- var factory = new MockFactory(MockBehavior.Default);
-
- var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true);
-
-
- // Throws an exception for a call to Remove with any string value.
- mock.Protected()
- .Expect("Remove", ItExpr.IsAny<string>())
- .Throws(new InvalidOperationException());
-
-
- mock.Protected()
- .Expect("Do", ItExpr.Is<int>(i => i % 2 == 0))
- .Returns(1);
-
- This example shows how to throw an exception if the argument to the
- method is a negative number:
-
- mock.Protected()
- .Expect("GetUser", ItExpr.Is<int>(i => i < 0))
- .Throws(new ArgumentException());
-
-
- mock.Protected()
- .Expect("HasInventory",
- ItExpr.IsAny<string>(),
- ItExpr.IsInRange(0, 100, Range.Inclusive))
- .Returns(false);
-
-
- mock.Protected()
- .Expect("Check", ItExpr.IsRegex("[a-z]+"))
- .Returns(1);
-
-
- mock.Protected()
- .Expect("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase))
- .Returns(1);
-
- var mock = new Mock<MyProvider>(someArgument, 25);
- var mock = new Mock<IFormatProvider>();
- var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed);
- var mock = new Mock<MyProvider>(someArgument, 25);
-
- var mock = new Mock<IHaveValue>();
- mock.Stub(v => v.Value);
-
- After the
- IHaveValue v = mock.Object;
-
- v.Value = 5;
- Assert.Equal(5, v.Value);
-
-
- var mock = new Mock<IHaveValue>();
- mock.Stub(v => v.Value, 5);
-
- After the
- IHaveValue v = mock.Object;
- // Initial value was stored
- Assert.Equal(5, v.Value);
-
- // New value set which changes the initial value
- v.Value = 6;
- Assert.Equal(6, v.Value);
-
- null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null null then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an <?php ... ?> tags.
+ Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method.
+ <% ... %> tags.
+ Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method.
+ <--# ... --> tags.
+ Could be passed inside a list to {@link #setPreservePatterns(List) setPreservePatterns} method.
+ <div> and <li> tags.
+ Table tags are also included.
+ Could be passed to {@link #setRemoveSurroundingSpaces(string) setRemoveSurroundingSpaces} method.
+ false all compression will be bypassed. Might be useful for testing purposes.
+ Default is true.
- Usage of HttpListener allows you to host webservices on the same port (:80) as IIS
- however it requires admin user privillages.
-
- false to bypass all compression
+ true all HTML comments will be removed.
+ Default is true.
- We assume that the WorkItem object is created within the thread
- that meant to run the callback
- true to remove all HTML comments
+ true all multiple whitespace characters will be replaced with single spaces.
+ Default is true.
- If a non-null object is returned the request will short-circuit and return that response.
-
- The instance of the service
- GET,POST,PUT,DELETE
-
-
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
+ @param removeMultiSpaces set true to replace all multiple whitespace characters
+ will single spaces.
+ true. Default is false for performance reasons.
+
+ Note: Compressing JavaScript is not recommended if pages are + compressed dynamically on-the-fly because of performance impact. + You should consider putting JavaScript into a separate file and + compressing it using standalone YUICompressor for example.
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> { - v => v.RuleFor(x => x.Name).NotNull(), - v => v.RuleFor(x => x.Id).NotEqual(0), - } - } - - -true to enable JavaScript compression.
+ Default is false
+ true. Default is false for performance reasons.
+
+ Note: Compressing CSS is not recommended if pages are + compressed dynamically on-the-fly because of performance impact. + You should consider putting CSS into a separate file and + compressing it using standalone YUICompressor for example.
- - - - -true to enable CSS compression.
+ Default is false
+ true, existing DOCTYPE declaration will be replaced with simple <!DOCTYPE html> declaration.
+ Default is false.
- PathToSupress is the path inside your website where the above swap should happen.
+ @param simpleDoctype set true to replace existing DOCTYPE declaration with <!DOCTYPE html>
+ true, type="text/style" attributes will be removed from <style> tags. Default is false.
- If you can build for .net 4.5, you do not have to do this swap. You can take advantage of a new flag (SuppressFormsAuthenticationRedirect)
- that tells the FormAuthenticationModule to not redirect, which also means you will not need the EndRequest code.
-
- true to remove type="text/style" attributes from <style> tags
+ true, method="get" attributes will be removed from <form> tags. Default is false.
+
+ @param removeFormAttributes set true to remove method="get" attributes from <form> tags
+ true, type="text" attributes will be removed from <input> tags. Default is false.
+
+ @param removeInputAttributes set true to remove type="text" attributes from <input> tags
+ <pre> tags or inside
+ <script> tags with disabled javascript compression)
+
+ @return the total size of blocks that were skipped by the compressor, in bytes
+ <script> tags
+
+ @return total size of inline <script> tags, in bytes
+ <style> tags
+
+ @return total size of inline <style> tags, in bytes
+ onclick, etc)
+
+ @return total size of inline event handlers, in bytes
+
+ public class Customer {
+ public int Id { get; set; }
+ public string Name { get; set; }
+
+ public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
+ v => v.RuleFor(x => x.Name).NotNull(),
+ v => v.RuleFor(x => x.Id).NotEqual(0),
+ }
+ }
+
+
+ enum UserColors
+ {
+ [Description("Bright Red")]
+ BrightRed
+ }
+ UserColors.BrightRed.ToDescription();
+
+ ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true;
+ ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true;
+ IsEmpty(default(TStoredI)) should always be true.ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true;
+ ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true;
+ IsEmpty(default(TStoredI)) should always be true.
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
-
-
-
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
- null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an
- public class Customer {
- public int Id { get; set; }
- public string Name { get; set; }
-
- public static readonly InlineValidator<Customer> Validator = new InlineValidator<Customer> {
- v => v.RuleFor(x => x.Name).NotNull(),
- v => v.RuleFor(x => x.Id).NotEqual(0),
- }
- }
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-
- enum UserColors
- {
- [Description("Bright Red")]
- BrightRed
- }
- UserColors.BrightRed.ToDescription();
-
-