1package namesilo 2 3import ( 4 "encoding/xml" 5 "fmt" 6 "io/ioutil" 7 "testing" 8) 9 10func TestAddAccountFunds(t *testing.T) { 11 bytes, err := ioutil.ReadFile("./samples/addAccountFunds.xml") 12 if err != nil { 13 t.Fatal(err) 14 } 15 16 model := &AddAccountFunds{} 17 err = xml.Unmarshal(bytes, model) 18 if err != nil { 19 t.Fatal(err) 20 } 21 22 indent, err := xml.MarshalIndent(model, "", " ") 23 if err != nil { 24 t.Fatal(err) 25 } 26 27 if fmt.Sprintln(string(indent)) != string(bytes) { 28 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 29 t.Error("Errors") 30 } 31} 32 33func TestAddAutoRenewal(t *testing.T) { 34 bytes, err := ioutil.ReadFile("./samples/addAutoRenewal.xml") 35 if err != nil { 36 t.Fatal(err) 37 } 38 39 model := &AddAutoRenewal{} 40 err = xml.Unmarshal(bytes, model) 41 if err != nil { 42 t.Fatal(err) 43 } 44 45 indent, err := xml.MarshalIndent(model, "", " ") 46 if err != nil { 47 t.Fatal(err) 48 } 49 50 if fmt.Sprintln(string(indent)) != string(bytes) { 51 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 52 t.Error("Errors") 53 } 54} 55 56func TestAddPrivacy(t *testing.T) { 57 bytes, err := ioutil.ReadFile("./samples/addPrivacy.xml") 58 if err != nil { 59 t.Fatal(err) 60 } 61 62 model := &AddPrivacy{} 63 err = xml.Unmarshal(bytes, model) 64 if err != nil { 65 t.Fatal(err) 66 } 67 68 indent, err := xml.MarshalIndent(model, "", " ") 69 if err != nil { 70 t.Fatal(err) 71 } 72 73 if fmt.Sprintln(string(indent)) != string(bytes) { 74 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 75 t.Error("Errors") 76 } 77} 78 79func TestAddRegisteredNameServer(t *testing.T) { 80 bytes, err := ioutil.ReadFile("./samples/addRegisteredNameServer.xml") 81 if err != nil { 82 t.Fatal(err) 83 } 84 85 model := &AddRegisteredNameServer{} 86 err = xml.Unmarshal(bytes, model) 87 if err != nil { 88 t.Fatal(err) 89 } 90 91 indent, err := xml.MarshalIndent(model, "", " ") 92 if err != nil { 93 t.Fatal(err) 94 } 95 96 if fmt.Sprintln(string(indent)) != string(bytes) { 97 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 98 t.Error("Errors") 99 } 100} 101 102func TestChangeNameServers(t *testing.T) { 103 bytes, err := ioutil.ReadFile("./samples/changeNameServers.xml") 104 if err != nil { 105 t.Fatal(err) 106 } 107 108 model := &ChangeNameServers{} 109 err = xml.Unmarshal(bytes, model) 110 if err != nil { 111 t.Fatal(err) 112 } 113 114 indent, err := xml.MarshalIndent(model, "", " ") 115 if err != nil { 116 t.Fatal(err) 117 } 118 119 if fmt.Sprintln(string(indent)) != string(bytes) { 120 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 121 t.Error("Errors") 122 } 123} 124 125func TestCheckRegisterAvailability(t *testing.T) { 126 bytes, err := ioutil.ReadFile("./samples/checkRegisterAvailability.xml") 127 if err != nil { 128 t.Fatal(err) 129 } 130 131 model := &CheckRegisterAvailability{} 132 err = xml.Unmarshal(bytes, model) 133 if err != nil { 134 t.Fatal(err) 135 } 136 137 indent, err := xml.MarshalIndent(model, "", " ") 138 if err != nil { 139 t.Fatal(err) 140 } 141 142 if fmt.Sprintln(string(indent)) != string(bytes) { 143 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 144 t.Error("Errors") 145 } 146} 147 148func TestCheckTransferAvailability(t *testing.T) { 149 bytes, err := ioutil.ReadFile("./samples/checkTransferAvailability.xml") 150 if err != nil { 151 t.Fatal(err) 152 } 153 154 model := &CheckTransferAvailability{} 155 err = xml.Unmarshal(bytes, model) 156 if err != nil { 157 t.Fatal(err) 158 } 159 160 indent, err := xml.MarshalIndent(model, "", " ") 161 if err != nil { 162 t.Fatal(err) 163 } 164 165 if fmt.Sprintln(string(indent)) != string(bytes) { 166 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 167 t.Error("Errors") 168 } 169} 170 171func TestCheckTransferStatus(t *testing.T) { 172 bytes, err := ioutil.ReadFile("./samples/checkTransferStatus.xml") 173 if err != nil { 174 t.Fatal(err) 175 } 176 177 model := &CheckTransferStatus{} 178 err = xml.Unmarshal(bytes, model) 179 if err != nil { 180 t.Fatal(err) 181 } 182 183 indent, err := xml.MarshalIndent(model, "", " ") 184 if err != nil { 185 t.Fatal(err) 186 } 187 188 if fmt.Sprintln(string(indent)) != string(bytes) { 189 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 190 t.Error("Errors") 191 } 192} 193 194func TestConfigureEmailForward(t *testing.T) { 195 bytes, err := ioutil.ReadFile("./samples/configureEmailForward.xml") 196 if err != nil { 197 t.Fatal(err) 198 } 199 200 model := &ConfigureEmailForward{} 201 err = xml.Unmarshal(bytes, model) 202 if err != nil { 203 t.Fatal(err) 204 } 205 206 indent, err := xml.MarshalIndent(model, "", " ") 207 if err != nil { 208 t.Fatal(err) 209 } 210 211 if fmt.Sprintln(string(indent)) != string(bytes) { 212 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 213 t.Error("Errors") 214 } 215} 216 217func TestContactAdd(t *testing.T) { 218 bytes, err := ioutil.ReadFile("./samples/contactAdd.xml") 219 if err != nil { 220 t.Fatal(err) 221 } 222 223 model := &ContactAdd{} 224 err = xml.Unmarshal(bytes, model) 225 if err != nil { 226 t.Fatal(err) 227 } 228 229 indent, err := xml.MarshalIndent(model, "", " ") 230 if err != nil { 231 t.Fatal(err) 232 } 233 234 if fmt.Sprintln(string(indent)) != string(bytes) { 235 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 236 t.Error("Errors") 237 } 238} 239 240func TestContactDelete(t *testing.T) { 241 bytes, err := ioutil.ReadFile("./samples/contactDelete.xml") 242 if err != nil { 243 t.Fatal(err) 244 } 245 246 model := &ContactDelete{} 247 err = xml.Unmarshal(bytes, model) 248 if err != nil { 249 t.Fatal(err) 250 } 251 252 indent, err := xml.MarshalIndent(model, "", " ") 253 if err != nil { 254 t.Fatal(err) 255 } 256 257 if fmt.Sprintln(string(indent)) != string(bytes) { 258 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 259 t.Error("Errors") 260 } 261} 262 263func TestContactDomainAssociate(t *testing.T) { 264 bytes, err := ioutil.ReadFile("./samples/contactDomainAssociate.xml") 265 if err != nil { 266 t.Fatal(err) 267 } 268 269 model := &ContactDomainAssociate{} 270 err = xml.Unmarshal(bytes, model) 271 if err != nil { 272 t.Fatal(err) 273 } 274 275 indent, err := xml.MarshalIndent(model, "", " ") 276 if err != nil { 277 t.Fatal(err) 278 } 279 280 if fmt.Sprintln(string(indent)) != string(bytes) { 281 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 282 t.Error("Errors") 283 } 284} 285 286func TestContactList(t *testing.T) { 287 t.Skip("because <usnc/> become <usnc></usnc>") 288 289 bytes, err := ioutil.ReadFile("./samples/contactList.xml") 290 if err != nil { 291 t.Fatal(err) 292 } 293 294 model := &ContactList{} 295 err = xml.Unmarshal(bytes, model) 296 if err != nil { 297 t.Fatal(err) 298 } 299 300 indent, err := xml.MarshalIndent(model, "", " ") 301 if err != nil { 302 t.Fatal(err) 303 } 304 305 if fmt.Sprintln(string(indent)) != string(bytes) { 306 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 307 t.Error("Errors") 308 } 309} 310 311func TestContactUpdate(t *testing.T) { 312 bytes, err := ioutil.ReadFile("./samples/contactUpdate.xml") 313 if err != nil { 314 t.Fatal(err) 315 } 316 317 model := &ContactUpdate{} 318 err = xml.Unmarshal(bytes, model) 319 if err != nil { 320 t.Fatal(err) 321 } 322 323 indent, err := xml.MarshalIndent(model, "", " ") 324 if err != nil { 325 t.Fatal(err) 326 } 327 328 if fmt.Sprintln(string(indent)) != string(bytes) { 329 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 330 t.Error("Errors") 331 } 332} 333 334func TestDeleteEmailForward(t *testing.T) { 335 bytes, err := ioutil.ReadFile("./samples/deleteEmailForward.xml") 336 if err != nil { 337 t.Fatal(err) 338 } 339 340 model := &DeleteEmailForward{} 341 err = xml.Unmarshal(bytes, model) 342 if err != nil { 343 t.Fatal(err) 344 } 345 346 indent, err := xml.MarshalIndent(model, "", " ") 347 if err != nil { 348 t.Fatal(err) 349 } 350 351 if fmt.Sprintln(string(indent)) != string(bytes) { 352 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 353 t.Error("Errors") 354 } 355} 356 357func TestDeleteRegisteredNameServer(t *testing.T) { 358 bytes, err := ioutil.ReadFile("./samples/deleteRegisteredNameServer.xml") 359 if err != nil { 360 t.Fatal(err) 361 } 362 363 model := &DeleteRegisteredNameServer{} 364 err = xml.Unmarshal(bytes, model) 365 if err != nil { 366 t.Fatal(err) 367 } 368 369 indent, err := xml.MarshalIndent(model, "", " ") 370 if err != nil { 371 t.Fatal(err) 372 } 373 374 if fmt.Sprintln(string(indent)) != string(bytes) { 375 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 376 t.Error("Errors") 377 } 378} 379 380func TestDnsAddRecord(t *testing.T) { 381 bytes, err := ioutil.ReadFile("./samples/dnsAddRecord.xml") 382 if err != nil { 383 t.Fatal(err) 384 } 385 386 model := &DnsAddRecord{} 387 err = xml.Unmarshal(bytes, model) 388 if err != nil { 389 t.Fatal(err) 390 } 391 392 indent, err := xml.MarshalIndent(model, "", " ") 393 if err != nil { 394 t.Fatal(err) 395 } 396 397 if fmt.Sprintln(string(indent)) != string(bytes) { 398 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 399 t.Error("Errors") 400 } 401} 402 403func TestDnsDeleteRecord(t *testing.T) { 404 bytes, err := ioutil.ReadFile("./samples/dnsDeleteRecord.xml") 405 if err != nil { 406 t.Fatal(err) 407 } 408 409 model := &DnsDeleteRecord{} 410 err = xml.Unmarshal(bytes, model) 411 if err != nil { 412 t.Fatal(err) 413 } 414 415 indent, err := xml.MarshalIndent(model, "", " ") 416 if err != nil { 417 t.Fatal(err) 418 } 419 420 if fmt.Sprintln(string(indent)) != string(bytes) { 421 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 422 t.Error("Errors") 423 } 424} 425 426func TestDnsListRecords(t *testing.T) { 427 bytes, err := ioutil.ReadFile("./samples/dnsListRecords.xml") 428 if err != nil { 429 t.Fatal(err) 430 } 431 432 model := &DnsListRecords{} 433 err = xml.Unmarshal(bytes, model) 434 if err != nil { 435 t.Fatal(err) 436 } 437 438 indent, err := xml.MarshalIndent(model, "", " ") 439 if err != nil { 440 t.Fatal(err) 441 } 442 443 if fmt.Sprintln(string(indent)) != string(bytes) { 444 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 445 t.Error("Errors") 446 } 447} 448 449func TestDnsSecAddRecord(t *testing.T) { 450 bytes, err := ioutil.ReadFile("./samples/dnsSecAddRecord.xml") 451 if err != nil { 452 t.Fatal(err) 453 } 454 455 model := &DnsSecAddRecord{} 456 err = xml.Unmarshal(bytes, model) 457 if err != nil { 458 t.Fatal(err) 459 } 460 461 indent, err := xml.MarshalIndent(model, "", " ") 462 if err != nil { 463 t.Fatal(err) 464 } 465 466 if fmt.Sprintln(string(indent)) != string(bytes) { 467 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 468 t.Error("Errors") 469 } 470} 471 472func TestDnsSecDeleteRecord(t *testing.T) { 473 bytes, err := ioutil.ReadFile("./samples/dnsSecDeleteRecord.xml") 474 if err != nil { 475 t.Fatal(err) 476 } 477 478 model := &DnsSecDeleteRecord{} 479 err = xml.Unmarshal(bytes, model) 480 if err != nil { 481 t.Fatal(err) 482 } 483 484 indent, err := xml.MarshalIndent(model, "", " ") 485 if err != nil { 486 t.Fatal(err) 487 } 488 489 if fmt.Sprintln(string(indent)) != string(bytes) { 490 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 491 t.Error("Errors") 492 } 493} 494 495func TestDnsSecListRecords(t *testing.T) { 496 bytes, err := ioutil.ReadFile("./samples/dnsSecListRecords.xml") 497 if err != nil { 498 t.Fatal(err) 499 } 500 501 model := &DnsSecListRecords{} 502 err = xml.Unmarshal(bytes, model) 503 if err != nil { 504 t.Fatal(err) 505 } 506 507 indent, err := xml.MarshalIndent(model, "", " ") 508 if err != nil { 509 t.Fatal(err) 510 } 511 512 if fmt.Sprintln(string(indent)) != string(bytes) { 513 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 514 t.Error("Errors") 515 } 516} 517 518func TestDnsUpdateRecord(t *testing.T) { 519 bytes, err := ioutil.ReadFile("./samples/dnsUpdateRecord.xml") 520 if err != nil { 521 t.Fatal(err) 522 } 523 524 model := &DnsUpdateRecord{} 525 err = xml.Unmarshal(bytes, model) 526 if err != nil { 527 t.Fatal(err) 528 } 529 530 indent, err := xml.MarshalIndent(model, "", " ") 531 if err != nil { 532 t.Fatal(err) 533 } 534 535 if fmt.Sprintln(string(indent)) != string(bytes) { 536 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 537 t.Error("Errors") 538 } 539} 540 541func TestDomainForward(t *testing.T) { 542 bytes, err := ioutil.ReadFile("./samples/domainForward.xml") 543 if err != nil { 544 t.Fatal(err) 545 } 546 547 model := &DomainForward{} 548 err = xml.Unmarshal(bytes, model) 549 if err != nil { 550 t.Fatal(err) 551 } 552 553 indent, err := xml.MarshalIndent(model, "", " ") 554 if err != nil { 555 t.Fatal(err) 556 } 557 558 if fmt.Sprintln(string(indent)) != string(bytes) { 559 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 560 t.Error("Errors") 561 } 562} 563 564func TestDomainForwardSubDomain(t *testing.T) { 565 bytes, err := ioutil.ReadFile("./samples/domainForwardSubDomain.xml") 566 if err != nil { 567 t.Fatal(err) 568 } 569 570 model := &DomainForwardSubDomain{} 571 err = xml.Unmarshal(bytes, model) 572 if err != nil { 573 t.Fatal(err) 574 } 575 576 indent, err := xml.MarshalIndent(model, "", " ") 577 if err != nil { 578 t.Fatal(err) 579 } 580 581 if fmt.Sprintln(string(indent)) != string(bytes) { 582 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 583 t.Error("Errors") 584 } 585} 586 587func TestDomainForwardSubDomainDelete(t *testing.T) { 588 bytes, err := ioutil.ReadFile("./samples/domainForwardSubDomainDelete.xml") 589 if err != nil { 590 t.Fatal(err) 591 } 592 593 model := &DomainForwardSubDomainDelete{} 594 err = xml.Unmarshal(bytes, model) 595 if err != nil { 596 t.Fatal(err) 597 } 598 599 indent, err := xml.MarshalIndent(model, "", " ") 600 if err != nil { 601 t.Fatal(err) 602 } 603 604 if fmt.Sprintln(string(indent)) != string(bytes) { 605 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 606 t.Error("Errors") 607 } 608} 609 610func TestDomainLock(t *testing.T) { 611 bytes, err := ioutil.ReadFile("./samples/domainLock.xml") 612 if err != nil { 613 t.Fatal(err) 614 } 615 616 model := &DomainLock{} 617 err = xml.Unmarshal(bytes, model) 618 if err != nil { 619 t.Fatal(err) 620 } 621 622 indent, err := xml.MarshalIndent(model, "", " ") 623 if err != nil { 624 t.Fatal(err) 625 } 626 627 if fmt.Sprintln(string(indent)) != string(bytes) { 628 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 629 t.Error("Errors") 630 } 631} 632 633func TestDomainUnlock(t *testing.T) { 634 bytes, err := ioutil.ReadFile("./samples/domainUnlock.xml") 635 if err != nil { 636 t.Fatal(err) 637 } 638 639 model := &DomainUnlock{} 640 err = xml.Unmarshal(bytes, model) 641 if err != nil { 642 t.Fatal(err) 643 } 644 645 indent, err := xml.MarshalIndent(model, "", " ") 646 if err != nil { 647 t.Fatal(err) 648 } 649 650 if fmt.Sprintln(string(indent)) != string(bytes) { 651 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 652 t.Error("Errors") 653 } 654} 655 656func TestEmailVerification(t *testing.T) { 657 bytes, err := ioutil.ReadFile("./samples/emailVerification.xml") 658 if err != nil { 659 t.Fatal(err) 660 } 661 662 model := &EmailVerification{} 663 err = xml.Unmarshal(bytes, model) 664 if err != nil { 665 t.Fatal(err) 666 } 667 668 indent, err := xml.MarshalIndent(model, "", " ") 669 if err != nil { 670 t.Fatal(err) 671 } 672 673 if fmt.Sprintln(string(indent)) != string(bytes) { 674 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 675 t.Error("Errors") 676 } 677} 678 679func TestGetAccountBalance(t *testing.T) { 680 bytes, err := ioutil.ReadFile("./samples/getAccountBalance.xml") 681 if err != nil { 682 t.Fatal(err) 683 } 684 685 model := &GetAccountBalance{} 686 err = xml.Unmarshal(bytes, model) 687 if err != nil { 688 t.Fatal(err) 689 } 690 691 indent, err := xml.MarshalIndent(model, "", " ") 692 if err != nil { 693 t.Fatal(err) 694 } 695 696 if fmt.Sprintln(string(indent)) != string(bytes) { 697 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 698 t.Error("Errors") 699 } 700} 701 702func TestGetDomainInfo(t *testing.T) { 703 bytes, err := ioutil.ReadFile("./samples/getDomainInfo.xml") 704 if err != nil { 705 t.Fatal(err) 706 } 707 708 model := &GetDomainInfo{} 709 err = xml.Unmarshal(bytes, model) 710 if err != nil { 711 t.Fatal(err) 712 } 713 714 indent, err := xml.MarshalIndent(model, "", " ") 715 if err != nil { 716 t.Fatal(err) 717 } 718 719 if fmt.Sprintln(string(indent)) != string(bytes) { 720 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 721 t.Error("Errors") 722 } 723} 724 725func TestGetPrices(t *testing.T) { 726 bytes, err := ioutil.ReadFile("./samples/getPrices.xml") 727 if err != nil { 728 t.Fatal(err) 729 } 730 731 model := &GetPrices{} 732 err = xml.Unmarshal(bytes, model) 733 if err != nil { 734 t.Fatal(err) 735 } 736 737 indent, err := xml.MarshalIndent(model, "", " ") 738 if err != nil { 739 t.Fatal(err) 740 } 741 742 if fmt.Sprintln(string(indent)) != string(bytes) { 743 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 744 t.Error("Errors") 745 } 746} 747 748func TestListDomains(t *testing.T) { 749 bytes, err := ioutil.ReadFile("./samples/listDomains.xml") 750 if err != nil { 751 t.Fatal(err) 752 } 753 754 model := &ListDomains{} 755 err = xml.Unmarshal(bytes, model) 756 if err != nil { 757 t.Fatal(err) 758 } 759 760 indent, err := xml.MarshalIndent(model, "", " ") 761 if err != nil { 762 t.Fatal(err) 763 } 764 765 if fmt.Sprintln(string(indent)) != string(bytes) { 766 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 767 t.Error("Errors") 768 } 769} 770 771func TestListEmailForwards(t *testing.T) { 772 bytes, err := ioutil.ReadFile("./samples/listEmailForwards.xml") 773 if err != nil { 774 t.Fatal(err) 775 } 776 777 model := &ListEmailForwards{} 778 err = xml.Unmarshal(bytes, model) 779 if err != nil { 780 t.Fatal(err) 781 } 782 783 indent, err := xml.MarshalIndent(model, "", " ") 784 if err != nil { 785 t.Fatal(err) 786 } 787 788 if fmt.Sprintln(string(indent)) != string(bytes) { 789 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 790 t.Error("Errors") 791 } 792} 793 794func TestListOrders(t *testing.T) { 795 bytes, err := ioutil.ReadFile("./samples/listOrders.xml") 796 if err != nil { 797 t.Fatal(err) 798 } 799 800 model := &ListOrders{} 801 err = xml.Unmarshal(bytes, model) 802 if err != nil { 803 t.Fatal(err) 804 } 805 806 indent, err := xml.MarshalIndent(model, "", " ") 807 if err != nil { 808 t.Fatal(err) 809 } 810 811 if fmt.Sprintln(string(indent)) != string(bytes) { 812 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 813 t.Error("Errors") 814 } 815} 816 817func TestListRegisteredNameServers(t *testing.T) { 818 bytes, err := ioutil.ReadFile("./samples/listRegisteredNameServers.xml") 819 if err != nil { 820 t.Fatal(err) 821 } 822 823 model := &ListRegisteredNameServers{} 824 err = xml.Unmarshal(bytes, model) 825 if err != nil { 826 t.Fatal(err) 827 } 828 829 indent, err := xml.MarshalIndent(model, "", " ") 830 if err != nil { 831 t.Fatal(err) 832 } 833 834 if fmt.Sprintln(string(indent)) != string(bytes) { 835 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 836 t.Error("Errors") 837 } 838} 839 840func TestMarketplaceActiveSalesOverview(t *testing.T) { 841 bytes, err := ioutil.ReadFile("./samples/marketplaceActiveSalesOverview.xml") 842 if err != nil { 843 t.Fatal(err) 844 } 845 846 model := &MarketplaceActiveSalesOverview{} 847 err = xml.Unmarshal(bytes, model) 848 if err != nil { 849 t.Fatal(err) 850 } 851 852 indent, err := xml.MarshalIndent(model, "", " ") 853 if err != nil { 854 t.Fatal(err) 855 } 856 857 if fmt.Sprintln(string(indent)) != string(bytes) { 858 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 859 t.Error("Errors") 860 } 861} 862 863func TestMarketplaceAddOrModifySale(t *testing.T) { 864 bytes, err := ioutil.ReadFile("./samples/marketplaceAddOrModifySale.xml") 865 if err != nil { 866 t.Fatal(err) 867 } 868 869 model := &MarketplaceAddOrModifySale{} 870 err = xml.Unmarshal(bytes, model) 871 if err != nil { 872 t.Fatal(err) 873 } 874 875 indent, err := xml.MarshalIndent(model, "", " ") 876 if err != nil { 877 t.Fatal(err) 878 } 879 880 if fmt.Sprintln(string(indent)) != string(bytes) { 881 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 882 t.Error("Errors") 883 } 884} 885 886func TestMarketplaceLandingPageUpdate(t *testing.T) { 887 bytes, err := ioutil.ReadFile("./samples/marketplaceLandingPageUpdate.xml") 888 if err != nil { 889 t.Fatal(err) 890 } 891 892 model := &MarketplaceLandingPageUpdate{} 893 err = xml.Unmarshal(bytes, model) 894 if err != nil { 895 t.Fatal(err) 896 } 897 898 indent, err := xml.MarshalIndent(model, "", " ") 899 if err != nil { 900 t.Fatal(err) 901 } 902 903 if fmt.Sprintln(string(indent)) != string(bytes) { 904 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 905 t.Error("Errors") 906 } 907} 908 909func TestModifyRegisteredNameServer(t *testing.T) { 910 bytes, err := ioutil.ReadFile("./samples/modifyRegisteredNameServer.xml") 911 if err != nil { 912 t.Fatal(err) 913 } 914 915 model := &ModifyRegisteredNameServer{} 916 err = xml.Unmarshal(bytes, model) 917 if err != nil { 918 t.Fatal(err) 919 } 920 921 indent, err := xml.MarshalIndent(model, "", " ") 922 if err != nil { 923 t.Fatal(err) 924 } 925 926 if fmt.Sprintln(string(indent)) != string(bytes) { 927 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 928 t.Error("Errors") 929 } 930} 931 932func TestOrderDetails(t *testing.T) { 933 bytes, err := ioutil.ReadFile("./samples/orderDetails.xml") 934 if err != nil { 935 t.Fatal(err) 936 } 937 938 model := &OrderDetails{} 939 err = xml.Unmarshal(bytes, model) 940 if err != nil { 941 t.Fatal(err) 942 } 943 944 indent, err := xml.MarshalIndent(model, "", " ") 945 if err != nil { 946 t.Fatal(err) 947 } 948 949 if fmt.Sprintln(string(indent)) != string(bytes) { 950 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 951 t.Error("Errors") 952 } 953} 954 955func TestPortfolioAdd(t *testing.T) { 956 bytes, err := ioutil.ReadFile("./samples/portfolioAdd.xml") 957 if err != nil { 958 t.Fatal(err) 959 } 960 961 model := &PortfolioAdd{} 962 err = xml.Unmarshal(bytes, model) 963 if err != nil { 964 t.Fatal(err) 965 } 966 967 indent, err := xml.MarshalIndent(model, "", " ") 968 if err != nil { 969 t.Fatal(err) 970 } 971 972 if fmt.Sprintln(string(indent)) != string(bytes) { 973 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 974 t.Error("Errors") 975 } 976} 977 978func TestPortfolioDelete(t *testing.T) { 979 bytes, err := ioutil.ReadFile("./samples/portfolioDelete.xml") 980 if err != nil { 981 t.Fatal(err) 982 } 983 984 model := &PortfolioDelete{} 985 err = xml.Unmarshal(bytes, model) 986 if err != nil { 987 t.Fatal(err) 988 } 989 990 indent, err := xml.MarshalIndent(model, "", " ") 991 if err != nil { 992 t.Fatal(err) 993 } 994 995 if fmt.Sprintln(string(indent)) != string(bytes) { 996 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 997 t.Error("Errors") 998 } 999} 1000 1001func TestPortfolioDomainAssociate(t *testing.T) { 1002 bytes, err := ioutil.ReadFile("./samples/portfolioDomainAssociate.xml") 1003 if err != nil { 1004 t.Fatal(err) 1005 } 1006 1007 model := &PortfolioDomainAssociate{} 1008 err = xml.Unmarshal(bytes, model) 1009 if err != nil { 1010 t.Fatal(err) 1011 } 1012 1013 indent, err := xml.MarshalIndent(model, "", " ") 1014 if err != nil { 1015 t.Fatal(err) 1016 } 1017 1018 if fmt.Sprintln(string(indent)) != string(bytes) { 1019 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1020 t.Error("Errors") 1021 } 1022} 1023 1024func TestPortfolioList(t *testing.T) { 1025 bytes, err := ioutil.ReadFile("./samples/portfolioList.xml") 1026 if err != nil { 1027 t.Fatal(err) 1028 } 1029 1030 model := &PortfolioList{} 1031 err = xml.Unmarshal(bytes, model) 1032 if err != nil { 1033 t.Fatal(err) 1034 } 1035 1036 indent, err := xml.MarshalIndent(model, "", " ") 1037 if err != nil { 1038 t.Fatal(err) 1039 } 1040 1041 if fmt.Sprintln(string(indent)) != string(bytes) { 1042 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1043 t.Error("Errors") 1044 } 1045} 1046 1047func TestRegisterDomain(t *testing.T) { 1048 bytes, err := ioutil.ReadFile("./samples/registerDomain.xml") 1049 if err != nil { 1050 t.Fatal(err) 1051 } 1052 1053 model := &RegisterDomain{} 1054 err = xml.Unmarshal(bytes, model) 1055 if err != nil { 1056 t.Fatal(err) 1057 } 1058 1059 indent, err := xml.MarshalIndent(model, "", " ") 1060 if err != nil { 1061 t.Fatal(err) 1062 } 1063 1064 if fmt.Sprintln(string(indent)) != string(bytes) { 1065 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1066 t.Error("Errors") 1067 } 1068} 1069 1070func TestRegisterDomainDrop(t *testing.T) { 1071 bytes, err := ioutil.ReadFile("./samples/registerDomainDrop.xml") 1072 if err != nil { 1073 t.Fatal(err) 1074 } 1075 1076 model := &RegisterDomainDrop{} 1077 err = xml.Unmarshal(bytes, model) 1078 if err != nil { 1079 t.Fatal(err) 1080 } 1081 1082 indent, err := xml.MarshalIndent(model, "", " ") 1083 if err != nil { 1084 t.Fatal(err) 1085 } 1086 1087 if fmt.Sprintln(string(indent)) != string(bytes) { 1088 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1089 t.Error("Errors") 1090 } 1091} 1092 1093func TestRegistrantVerificationStatus(t *testing.T) { 1094 bytes, err := ioutil.ReadFile("./samples/registrantVerificationStatus.xml") 1095 if err != nil { 1096 t.Fatal(err) 1097 } 1098 1099 model := &RegistrantVerificationStatus{} 1100 err = xml.Unmarshal(bytes, model) 1101 if err != nil { 1102 t.Fatal(err) 1103 } 1104 1105 indent, err := xml.MarshalIndent(model, "", " ") 1106 if err != nil { 1107 t.Fatal(err) 1108 } 1109 1110 if fmt.Sprintln(string(indent)) != string(bytes) { 1111 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1112 t.Error("Errors") 1113 } 1114} 1115 1116func TestRemoveAutoRenewal(t *testing.T) { 1117 bytes, err := ioutil.ReadFile("./samples/removeAutoRenewal.xml") 1118 if err != nil { 1119 t.Fatal(err) 1120 } 1121 1122 model := &RemoveAutoRenewal{} 1123 err = xml.Unmarshal(bytes, model) 1124 if err != nil { 1125 t.Fatal(err) 1126 } 1127 1128 indent, err := xml.MarshalIndent(model, "", " ") 1129 if err != nil { 1130 t.Fatal(err) 1131 } 1132 1133 if fmt.Sprintln(string(indent)) != string(bytes) { 1134 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1135 t.Error("Errors") 1136 } 1137} 1138 1139func TestRemovePrivacy(t *testing.T) { 1140 bytes, err := ioutil.ReadFile("./samples/removePrivacy.xml") 1141 if err != nil { 1142 t.Fatal(err) 1143 } 1144 1145 model := &RemovePrivacy{} 1146 err = xml.Unmarshal(bytes, model) 1147 if err != nil { 1148 t.Fatal(err) 1149 } 1150 1151 indent, err := xml.MarshalIndent(model, "", " ") 1152 if err != nil { 1153 t.Fatal(err) 1154 } 1155 1156 if fmt.Sprintln(string(indent)) != string(bytes) { 1157 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1158 t.Error("Errors") 1159 } 1160} 1161 1162func TestRenewDomain(t *testing.T) { 1163 bytes, err := ioutil.ReadFile("./samples/renewDomain.xml") 1164 if err != nil { 1165 t.Fatal(err) 1166 } 1167 1168 model := &RenewDomain{} 1169 err = xml.Unmarshal(bytes, model) 1170 if err != nil { 1171 t.Fatal(err) 1172 } 1173 1174 indent, err := xml.MarshalIndent(model, "", " ") 1175 if err != nil { 1176 t.Fatal(err) 1177 } 1178 1179 if fmt.Sprintln(string(indent)) != string(bytes) { 1180 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1181 t.Error("Errors") 1182 } 1183} 1184 1185func TestRetrieveAuthCode(t *testing.T) { 1186 bytes, err := ioutil.ReadFile("./samples/retrieveAuthCode.xml") 1187 if err != nil { 1188 t.Fatal(err) 1189 } 1190 1191 model := &RetrieveAuthCode{} 1192 err = xml.Unmarshal(bytes, model) 1193 if err != nil { 1194 t.Fatal(err) 1195 } 1196 1197 indent, err := xml.MarshalIndent(model, "", " ") 1198 if err != nil { 1199 t.Fatal(err) 1200 } 1201 1202 if fmt.Sprintln(string(indent)) != string(bytes) { 1203 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1204 t.Error("Errors") 1205 } 1206} 1207 1208func TestTransferDomain(t *testing.T) { 1209 bytes, err := ioutil.ReadFile("./samples/transferDomain.xml") 1210 if err != nil { 1211 t.Fatal(err) 1212 } 1213 1214 model := &TransferDomain{} 1215 err = xml.Unmarshal(bytes, model) 1216 if err != nil { 1217 t.Fatal(err) 1218 } 1219 1220 indent, err := xml.MarshalIndent(model, "", " ") 1221 if err != nil { 1222 t.Fatal(err) 1223 } 1224 1225 if fmt.Sprintln(string(indent)) != string(bytes) { 1226 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1227 t.Error("Errors") 1228 } 1229} 1230 1231func TestTransferUpdateChangeEPPCode(t *testing.T) { 1232 bytes, err := ioutil.ReadFile("./samples/transferUpdateChangeEPPCode.xml") 1233 if err != nil { 1234 t.Fatal(err) 1235 } 1236 1237 model := &TransferUpdateChangeEPPCode{} 1238 err = xml.Unmarshal(bytes, model) 1239 if err != nil { 1240 t.Fatal(err) 1241 } 1242 1243 indent, err := xml.MarshalIndent(model, "", " ") 1244 if err != nil { 1245 t.Fatal(err) 1246 } 1247 1248 if fmt.Sprintln(string(indent)) != string(bytes) { 1249 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1250 t.Error("Errors") 1251 } 1252} 1253 1254func TestTransferUpdateResendAdminEmail(t *testing.T) { 1255 bytes, err := ioutil.ReadFile("./samples/transferUpdateResendAdminEmail.xml") 1256 if err != nil { 1257 t.Fatal(err) 1258 } 1259 1260 model := &TransferUpdateResendAdminEmail{} 1261 err = xml.Unmarshal(bytes, model) 1262 if err != nil { 1263 t.Fatal(err) 1264 } 1265 1266 indent, err := xml.MarshalIndent(model, "", " ") 1267 if err != nil { 1268 t.Fatal(err) 1269 } 1270 1271 if fmt.Sprintln(string(indent)) != string(bytes) { 1272 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1273 t.Error("Errors") 1274 } 1275} 1276 1277func TestTransferUpdateResubmitToRegistry(t *testing.T) { 1278 bytes, err := ioutil.ReadFile("./samples/transferUpdateResubmitToRegistry.xml") 1279 if err != nil { 1280 t.Fatal(err) 1281 } 1282 1283 model := &TransferUpdateResubmitToRegistry{} 1284 err = xml.Unmarshal(bytes, model) 1285 if err != nil { 1286 t.Fatal(err) 1287 } 1288 1289 indent, err := xml.MarshalIndent(model, "", " ") 1290 if err != nil { 1291 t.Fatal(err) 1292 } 1293 1294 if fmt.Sprintln(string(indent)) != string(bytes) { 1295 t.Logf("Got:\n%s\n\nWant:\n%s\n", string(indent), string(bytes)) 1296 t.Error("Errors") 1297 } 1298} 1299