static void Main () { Moo moo = new Moo (ValTyp.Empty); Assert.IsFalse (moo.nvt.HasValue, "#1"); moo = new Moo (ValTyp.Empty); Assert.IsFalse (moo.nvt.HasValue, "#2"); }
public static void Main(string[] args) { var m = new Moo(); var a = new BlobArray<uint>(); a.Add(89); a.Add(99); a.Add(109); m.Po = a; m.Text = "A string!"; m.Array[0].Meh = 7; m.Array[1].Beh = 2.7f; m.Array2[0][1] = 2; BlobSerializer s = new BlobSerializer(); s.BigEndian = false; s.Write(m); using (Stream data = File.OpenWrite("output")) using (Stream relocs = File.OpenWrite("output.relocs")) { s.GenerateOutput(data, relocs); } }
public void can_install_a_nupkg() { Moo.Packages.Should(Be.Empty); Directory.Exists(PathToTempHome(".moo")).ShouldBeFalse(); Moo.Install(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg")); Directory.Exists(PathToTempHome(".moo")).ShouldBeTrue(); // nupkg should be copied into ~/.moo/cache File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue(); // nuspec should be copied into ~/.moo/specifications File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeTrue(); // bin directory should be created, although MarkdownSharp doesn't have any executables, so it will be empty Directory.Exists(PathToTempHome(".moo", "bin")).ShouldBeTrue(); // it should unpack MarkdownSharp into ~/.moo/packages/ // we don't currently mess with anything in the nupkg except we don't unpack stupid things like the psmdcp or [Content_Types] or _rels // we will probably want to normalize the FrameworkName? // NOTE System.Runtime.Versioning.FrameworkName is only available in .NET 4.0 so we need to make our own File.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue(); // ignore stupid stuff! File.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "[Content_Types].xml")).ShouldBeFalse(); Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "_rels")).ShouldBeFalse(); Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "package")).ShouldBeFalse(); Moo.Packages.Count.ShouldEqual(1); Moo.Packages.First().Id.ShouldEqual("MarkdownSharp"); }
public void BeTrippedOver() { //if (Moo != null) // //takes in this object(Cow), And No Addindg Information (Empty) // Moo(this, EventArgs.Empty); // Same thing - if(?) Moo() not null Moo?.Invoke(this, EventArgs.Empty); }
public void can_unpack_a_nupkg_into_the_current_directory() { Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeFalse(); // Unpack(nupkg [, directory to unpack into]); Moo.Unpack(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg"), TempDirectory); Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeTrue(); File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "MarkdownSharp.nuspec")).ShouldBeTrue(); File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue(); }
public void unpacks_into_properly_named_directory_even_if_nupkg_is_named_wrong() { Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeFalse(); // Unpack(nupkg [, directory to unpack into]); Moo.Unpack(PathToContent("packages", "unnamed.nupkg"), TempDirectory); Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeTrue(); File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "MarkdownSharp.nuspec")).ShouldBeTrue(); File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue(); }
public void can_uninstall() { Moo.Install(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg")); File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue(); File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeTrue(); Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0")).ShouldBeTrue(); Moo.Uninstall("MarkdownSharp"); File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue(); // we keep the cached nupkg File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeFalse(); Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0")).ShouldBeFalse(); }
public static object Run(string[] args) { var package = Moo.Uninstall(args[0]); if (package == null) { return(string.Format("Package not found: {0}", args[0])); } else { return(string.Format("Uninstalled {0}", package.IdAndVersion)); } }
public void UndefinedTest() { string u1 = "{}"; Moo m = JsonUtil.ToObject <Moo>(u1); Assert.AreEqual(m.b, null); Assert.AreEqual(m.a, null); Assert.AreEqual(m.c, null); string s = JsonUtil.ToJson(m); Assert.AreEqual(s, @"{""a"":null,""b"":null,""c"":null}"); }
public void UndefinedTest() { string u1 = "{}"; Moo m = Deserialize.To <Moo>(u1); Assert.AreEqual(m.b, null); Assert.AreEqual(m.a, null); Assert.AreEqual(m.c, null); string s = Serialize.From(m); Assert.AreEqual(s, "{}"); }
object Install(string packageName) { Package package = null; if (File.Exists(packageName)) { package = Moo.InstallFromNupkg(packageName); // this is a stupid place to pass in DryRun ... we should pass in an object ... } else { package = Moo.InstallFromSource(packageName, DryRun); } if (package == null) { return(string.Format("Package not found: {0}\n", packageName)); } else { return(string.Format("Installed {0}\n", package)); } }
public Boo(Moo m) { this.m = m; }
static void Test1() { Console.WriteLine("----Test1"); Moo <Test> moo = new Moo <Test>(); }
public ItemView() { var change = CreateButton("Change", "Change", (items, index) => items[index] = new Moo()); var removeBar = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { CreateButton("- Left", "RemoveLeft", (items, index) => items.RemoveAt(index - 1)), CreateButton("Remove", "Remove", (items, index) => items.RemoveAt(index)), CreateButton("- Right", "RemoveRight", (items, index) => items.RemoveAt(index + 1)), } }; var addBar = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand, Children = { CreateButton("+ Left", "AddLeft", (items, index) => items.Insert(index, new Moo())), CreateButton("+ Right", "AddRight", (items, index) => { if (index == items.Count - 1) { items.Add(new Moo()); } else { items.Insert(index + 1, new Moo()); } }), } }; var typeNameLabel = new Label() { StyleId = "typename" }; typeNameLabel.SetBinding(Label.TextProperty, nameof(Item.TypeName)); var idLabel = new Label() { AutomationId = "ItemId", StyleId = "id", TextColor = Color.White }; idLabel.SetBinding(Label.TextProperty, nameof(Item.Id)); Content = new StackLayout { Children = { typeNameLabel, idLabel, change, removeBar, addBar, } }; PropertyChanged += (s, e) => { if (e.PropertyName == "TextColor") { typeNameLabel.TextColor = TextColor; } }; }
static void Main() { Moo <Test> moo = new Moo <Test> (); }
public void CowChecker() { Moo?.Invoke(this, new CowEventsArgs(CowState.Awake)); }
public static object Run(string[] args) { var package = Moo.Unpack(args[0]); return(string.Format("Unpacked {0}", package.IdAndVersion)); }